Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to show files per build and whitelisting #264

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

abhiaagarwal
Copy link

@abhiaagarwal abhiaagarwal commented Apr 1, 2024

Adds the ability to show the files associated with a build in stdout. Useful for doing any pre-processing via jq before actually downloading the build.

Additionally adds a whitelisting capability. It uses the exact same logic as Blacklist (which has been renamed to Filelist to represent that it's more generic, but the same logic). I made it so that the whitelist takes precedent over the blacklist, but this can be changed as desired.

for (int i = 0; i < items.size(); i++) {
json_items[i]["product_id"] = items[i].product_id;
json_items[i]["path"] = items[i].path;
json_items[i]["size"] = static_cast<unsigned int>(items[i].totalSizeUncompressed);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is unsigned int big enough?
Perhaps std::uintmax_t would be better.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it is an std::uintmax_t internally — but for some reason, Json::Value has multiple overloads for the type, so I was forced to cast it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wanted to use a size_t for the loop itself, but it freaks out because their indexing operator seems to be overidded on multiple sizes or something

@abhiaagarwal
Copy link
Author

This PR expanded in scope as I added whitelisting capabilities, which I need for my use-case. More than happy to split up into another PR if desired.

@abhiaagarwal abhiaagarwal changed the title Add ability to show files per build Add ability to show files per build and whitelisting Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants