Skip to content

Allow job correlator of dependency graph to be customized #203

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

Closed
ebickle opened this issue Jul 15, 2024 · 0 comments · Fixed by #206
Closed

Allow job correlator of dependency graph to be customized #203

ebickle opened this issue Jul 15, 2024 · 0 comments · Fixed by #206

Comments

@ebickle
Copy link

ebickle commented Jul 15, 2024

Generated dependency graphs contain a job.correlator field used to differentiate submissions from different workflows.

When using a matrix to analyze the dependencies of multiple independent SBT builds in the same repository (e.g. "monorepos") this results in a race condition - since the correlator will be the same for each run of the GitHub workflow matrix, the last submission "wins" and overwrites all of the others.

To solve this, I'd like to propose adding a new correlator parameter to the action.yml that when set will be used as-is for the job.correlator value in the resulting dependency graph. When left blank (unset), the behavior would be the same as today.

I've run the solution by GitHub engineering via our GitHub professional services representative and they confirmed it was a reasonable solution - we have a similar draft PR pending for Maven over here: advanced-security/maven-dependency-submission-action#80. Note that in the draft PR the corrleator is appended not replaced - I don't recommend that solution as there is a strict 255 character internal limit for job correlators and long paths could easily overwhelm that limit and still cause collisions.

We're hoping to set the correlator property in all of our SBT dependency submissions so that we can roll it out as a general solution across all of our Scala repos without worrying about the potential for race conditions. I'll be helping with the Maven PR as well as submitting a similar request over to the Gradle team - the hope is that we can all coordinate on a single pattern (correlator action.yml parameter) for dependency submission actions.

Let me know if you have any questions! I'd submit a PR, but my Scala is rusty 😎

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 a pull request may close this issue.

1 participant