-
Notifications
You must be signed in to change notification settings - Fork 4
OSU-1514: introduce contract semver checks #394
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
Open
0xferit
wants to merge
16
commits into
develop
Choose a base branch
from
feature/osu-1514-add-date-based-version-tagging-ddmmyy-to-contracts-with-ci
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b135ee5
feat: add semantic version checks for contracts
0xferit 90b2332
fix(sol-semver): harden contract and lock validation
0xferit c681d5d
refactor(semver): use contract-declared versions only
0xferit 26b3214
refactor(semver): enforce VERSION constant only
0xferit 076c070
refactor(version): remove API_VERSION compatibility surface
0xferit 992a252
refactor(semver): align on API_VERSION across contracts and checks
0xferit 2f469bc
feat(semver): auto-discover changed versioned contracts
0xferit e375644
fix(semver): enforce API_VERSION on changed contracts
0xferit 851a0f1
fix(semver): analyze deleted contracts as breaking changes
0xferit 2a1b170
fix(semver): treat event anonymity changes as breaking
0xferit e68d9ad
fix(semver): handle merge-base and tuple/deletion discovery edge cases
0xferit 1b5e7c0
fix(semver): tighten workflow triggers and ABI/version edge checks
0xferit a5698da
fix(semver): handle renames and honor explicit contract scope
0xferit a135211
fix(semver): normalize renamed lock ids and ignore comment contracts
0xferit 3d96e7d
fix(semver): scope discovery to contracts declaring API_VERSION
0xferit fbf0986
ci: set safe.directory for merge-base in semver check
0xferit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Contract Semver Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - master | ||
| - develop | ||
| paths: | ||
| - 'src/**/*.sol' | ||
| - 'scripts/sol-semver.mjs' | ||
| - 'foundry.toml' | ||
| - 'remappings.txt' | ||
| - 'soldeer.lock' | ||
|
|
||
| jobs: | ||
| check-semver: | ||
| name: Verify contract semantic version bumps | ||
| runs-on: general | ||
| container: | ||
| image: ${{ vars.GCP_DOCKER_IMAGE_REGISTRY }}/node-extended:f4f41461 | ||
| credentials: | ||
| username: _json_key_base64 | ||
| password: ${{ secrets.GCP_DOCKER_IMAGES_REGISTRY_SERVICE_ACCOUNT }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Init env | ||
| run: | | ||
| yarn install | ||
| forge soldeer install | ||
|
|
||
| - name: Check semantic version bumps in changed contracts | ||
| env: | ||
| BASE_REF: ${{ github.event.pull_request.base.sha }} | ||
| HEAD_REF: ${{ github.event.pull_request.head.sha }} | ||
0xferit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| run: | | ||
| MERGE_BASE=$(git -c safe.directory="$PWD" merge-base "$BASE_REF" "$HEAD_REF") | ||
| node scripts/sol-semver.mjs check \ | ||
| --old-ref "$MERGE_BASE" \ | ||
| --new-ref "$HEAD_REF" | ||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.