Skip to content

fix: Branch blockers API extraction and processing #2183

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

Merged
merged 4 commits into from
Jun 12, 2025

Conversation

ch097711
Copy link
Contributor

@ch097711 ch097711 commented Jun 7, 2025

Previously, branch_blocker information was parsed from summary.json. However, a previous commit moved the branch_blocker information to branch-blockers.json, but the parsing logic was not updated accordingly. As shown in the figure, this API has no return value.

image

Therefore, this PR fixes the parsing of branch_blocker data to now be extracted from branch-blockers.json.

image

Copy link
Contributor

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

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

This looks good. I'm a bit unsure if we should land this because we're having some issues with storage size -- the branch blockers can be quite heavy and we need to watch out for taking up a lot of space.

@ch097711 ch097711 force-pushed the fix/branch-blockers-api branch from e6cd5d5 to f3d95f9 Compare June 10, 2025 09:07
@ch097711
Copy link
Contributor Author

I noticed a comment in the extract_local_project_data function that seems to prevent saving blocker information via save_branch_blockers:

    # Dump things we dont want to accummulate.
    #save_branch_blockers(branch_pairs, project_name)

However, this line is not commented out in the extract_project_data function:

If there's still a concern about storage and a need to prevent saving this blocker information, maybe we could comment out all calls to save_branch_blockers. I could then add a note to the documentation for the branch_blockers API to clarify that.

Thanks!

@DavidKorczynski
Copy link
Contributor

If there's still a concern about storage and a need to prevent saving this blocker information, maybe we could comment out all calls to save_branch_blockers. I could then add a note to the documentation for the branch_blockers API to clarify that.

Yeah, there's still a concern. Could you do this though? Then I'll run this locally and do some analysis on the memory consumption -- if it looks good we can enable it

…entation for the `/api/branch-blockers` endpoint

Signed-off-by: ch097711 <[email protected]>
@ch097711
Copy link
Contributor Author

Yeah, there's still a concern. Could you do this though? Then I'll run this locally and do some analysis on the memory consumption -- if it looks good we can enable it

I've commented out the save_branch_blockers calls and updated the Swagger note for the /api/branch-blockers endpoint.

Thanks!

Copy link
Contributor

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

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

actually, a thing we could do to avoid not providing the data is to lazily fetch the branch blockers in the webapp, could you do this? So that when an API request comes in that uses branch blockers, we'll dynamically fetch it when it's needed

@DavidKorczynski DavidKorczynski merged commit d1f6763 into ossf:main Jun 12, 2025
7 checks passed
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