Skip auto-generated ignore conditions for git SHA versions#616
Open
JamieMagee wants to merge 1 commit intomainfrom
Open
Skip auto-generated ignore conditions for git SHA versions#616JamieMagee wants to merge 1 commit intomainfrom
JamieMagee wants to merge 1 commit intomainfrom
Conversation
`generateIgnoreConditions` produces `version-requirement: '>X'` per `create_pull_request` output. When `X` is a 40-character git SHA (submodules, nix flake inputs pinned to a branch or rev), Ruby's `Gem::Requirement` rejects it as ill-formed and the smoke test fails. The previous workaround was an inline `pm != "submodules"` check that disabled generation for the entire ecosystem. That doesn't work for nix, which can mix SHA-pinned and tag-pinned (semver) flake inputs in the same lock file. Detect git SHAs at the individual condition level instead. Semver-style versions in any ecosystem still get a stability ignore condition; SHAs are skipped wherever they appear (see dependabot/smoke-tests#479).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
generateIgnoreConditionsadds aversion-requirement: '>X'entry percreate_pull_requestoutput so regenerated smoke tests stay stable. WhenXis a 40-character git SHA, Ruby'sGem::Requirementrejects it (BadRequirementError: Illformed requirement) and the smoke test run fails.The previous workaround was an inline
pm != "submodules"check that disabled the whole ecosystem. That worked for submodules (always SHAs) but doesn't fit nix, which mixes SHA-pinned and tag-pinned (semver) flake inputs in the same lock file. Skipping the entire ecosystem would also skip the legitimate semver tag deps. See dependabot/smoke-tests#479 for the failure that prompted this.This PR moves the check down to the individual condition: if a dependency's version matches a 40-character hex SHA, skip generating an ignore for it. Semver versions in any ecosystem still get one; SHAs are skipped wherever they appear. The existing
gitShaRegex(already used to validateSource.Commit) is reused.Test coverage:
Test_generateIgnoreConditions/skips_git_SHA_versionsasserts that a mixed dependency list produces a condition only for the semver entry.