Conversation
…y enforce this) (#1) Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This function was incorrectly comparing the segments of the two values and returning false if the segments were different Signed-off-by: Zane Burstein <zane.burstein@anchore.com>
…than-equal Remove prerelease check from less than equal
* upstream/main: (76 commits) correctly compare numeric prerelease values larger than int64 (hashicorp#212) docs: Add contributing guide and LLM PR template link. (hashicorp#209) Bump actions/checkout from 7.0.0 to 7.0.1 in the github-actions-backward-compatible group across 1 directory (hashicorp#203) fix: empty Version.String() prints 0.0.0 (hashicorp#201) Bump actions/setup-go from 6.5.0 to 7.0.0 in the github-actions-breaking group (hashicorp#200) Bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 in the github-actions-backward-compatible group (hashicorp#199) Bump the github-actions-breaking group with 2 updates (hashicorp#197) Bump actions/setup-go from 6.4.0 to 6.5.0 in the github-actions-backward-compatible group (hashicorp#198) ci: Add copywrite workflow and makefile for easier local dev. (hashicorp#196) [COMPLIANCE] Add/Update Copyright Headers (hashicorp#191) Bump the github-actions-backward-compatible group across 1 directory with 4 updates (hashicorp#194) Remove ip-compliance team from CODEOWNERS, transfer ownership to nomad-eng Add explicit go version to go.mod Update workflow to trigger on push events to main branch (hashicorp#188) Update CHANGELOG for version 1.9.0 (hashicorp#187) Bump the github-actions-backward-compatible group across 1 directory with 2 updates (hashicorp#186) Bump actions/upload-artifact from 6.0.0 to 7.0.0 in the github-actions-breaking group across 1 directory (hashicorp#183) Update GitHub Actions to trigger on pull requests and update go version (hashicorp#185) Support parsing versions with custom prefixes via opt-in option (hashicorp#79) Bump the github-actions-backward-compatible group with 3 updates ... Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes 0 out of 3 committers have signed the CLA.
Have you signed the CLA already but the status is still pending? Recheck it. |
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes 0 out of 3 committers have signed the CLA.
Have you signed the CLA already but the status is still pending? Recheck it. |
|
Apologies, this was meant to target our fork of go-version. Closing. |
Description
Sync this fork with
hashicorp/go-versionpicking up 93 upstream commits since the fork point (59da58c) while preserving Anchore commits.We are unarchiving this repository and maintaining it as part of Anchore, so this merge establishes the baseline that future syncs build on. No contributed Anchore behavior changes in this PR.
Anchore changes preserved (none of them modified by this merge):
Constraintsas[][]*Constraint, supporting||(or) constraints^(caret) and~(tilde) constraint operatorsMarshalJSON/UnmarshalJSONonVersionandConstraintsprereleaseCheck, per semver spec item 11comparePartordering for empty prerelease partsgithub.com/anchore/go-version, and README badges/links pointing at this forkUpstream changes that needed adapting to our 2D
Constraintstype:Upstream refactored
constraint.goin ways that assume the flatConstraints []*Constraint, so three things were reconciled rather than taken verbatim:constraintOperatorsmap (and itsinit()-built regexp) with a lazily-compiledgetConstraintRegexp()and aswitchinparseSingle. Our^and~operators were added to both, pluscaret/tildeentries in theoperatorconstants. Regexp alternation keeps~>ahead of~so pessimistic constraints still parse correctly.Constraints.Equalsandsort.InterfaceonConstraints, both written against the flat type. These are now:constraintGroup(sorts the constraints inside one comma-separated conjunction),Constraints.sorted()(sorts the groups and their contents), andConstraintsLen/Less/Swap(order the||groups).TestConstraint_sortcallssorted()and passes upstream's expectations unchanged.prereleaseChecknow uses upstream's newVersion.equalSegmentshelper instead ofreflect.DeepEqualonSegments64(), which drops thereflectimport.Notable upstream additions this brings in:
WithPrefixparsing option, for stripping a known release prefix before parsingVersion.Core(), returning just the MAJOR.MINOR.PATCH segmentsMarshalText/UnmarshalText, implementing theencodingtext interfacessql.Scanner/driver.Valuer, for reading and writing versions as SQL valuesMustConstraints, theConstraintscounterpart to the existingMustmath.MaxInt64String()on a zero-valueVersion, which previously printed empty rather than0.0.0Upstream repo tooling (
Makefile,.copywrite.hcl,CODEOWNERS,go-tests.yml,copywrite.yml,CHANGELOG.md,CONTRIBUTING.md, this PR template) is taken exactly as upstream ships it, so the diff stays reviewable as a pure resync. Replacing it with Anchore's standard tooling like go-make, binny, bouncer, chronicle, theanchore/workflowsreusable workflows,golangci.yamlwill be a follow-up PR stacked on this branch.To verify locally:
To confirm nothing of ours was reverted, diff the Anchore-owned surface against the pre-merge tip: