-
Notifications
You must be signed in to change notification settings - Fork 283
ci: Use renovate to update semantic conventions gem #2056
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,18 @@ | |||||||||||
| "config:best-practices", | ||||||||||||
| "helpers:pinGitHubActionDigestsToSemver" | ||||||||||||
| ], | ||||||||||||
| "regexManagers": [ | ||||||||||||
| { | ||||||||||||
| "fileMatch": ["^semantic_conventions/Rakefile$"], | ||||||||||||
| "matchStrings": [ | ||||||||||||
| "SPEC_VERSION = '(?<currentValue>.*?)'" | ||||||||||||
| ], | ||||||||||||
| "depNameTemplate": "open-telemetry/semantic-conventions", | ||||||||||||
| "datasourceTemplate": "github-releases", | ||||||||||||
| "versioningTemplate": "semver", | ||||||||||||
| "extractVersionTemplate": "^v(?<version>.*)$" | ||||||||||||
| } | ||||||||||||
| ], | ||||||||||||
| "packageRules": [ | ||||||||||||
| { | ||||||||||||
| "groupName": "all patch versions", | ||||||||||||
|
|
@@ -13,6 +25,13 @@ | |||||||||||
| { | ||||||||||||
| "matchUpdateTypes": ["minor", "major"], | ||||||||||||
| "schedule": ["before 8am on Monday"] | ||||||||||||
| }, | ||||||||||||
| { | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Judicious local running of renovate validate and dry-run shows me that with the We'd want to base 1.39.0 on 1.38.0 (and so on), though. I'm not sure what happens when the "to v1.38.0" PR merges. Would renovate rebase the still-open PRs to the new 1.38.0 "currentVersion"?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would either rebase it automatically or it would show as out of date & we would need to click the recreate button. I suspect we could limit it to 1 via limits if we needed to. |
||||||||||||
| "matchDatasources": ["github-releases"], | ||||||||||||
| "matchDepNames": ["open-telemetry/semantic-conventions"], | ||||||||||||
| "semanticCommitType": "feat", | ||||||||||||
| "semanticCommitScope": "semconv", | ||||||||||||
| "labels": ["dependencies", "semconv"] | ||||||||||||
| } | ||||||||||||
| ], | ||||||||||||
| "labels": [ | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,58 @@ | ||||||
| name: Renovate Semantic Conventions Post-Update | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| paths: | ||||||
| - 'semantic_conventions/Rakefile' | ||||||
| branches: | ||||||
| - main | ||||||
|
|
||||||
| permissions: | ||||||
| contents: write | ||||||
| pull-requests: write | ||||||
|
|
||||||
| jobs: | ||||||
| regenerate-semconv: | ||||||
| # Only run on Renovate PRs | ||||||
| if: startsWith(github.head_ref, 'renovate/') | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm intuiting the same intent here as before: pin an action to be consistent with how we're updating action versions with Renovate. |
||||||
| with: | ||||||
| ref: ${{ github.head_ref }} | ||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
|
||||||
| - name: Set up Ruby | ||||||
| uses: ruby/setup-ruby@v1 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm intuiting the intent here is to pin |
||||||
| with: | ||||||
| ruby-version: '3.3' | ||||||
| bundler-cache: true | ||||||
| working-directory: semantic_conventions | ||||||
|
|
||||||
| - name: Check if SPEC_VERSION changed | ||||||
| id: check_changes | ||||||
| run: | | ||||||
| git fetch origin ${{ github.base_ref }} | ||||||
| if git diff origin/${{ github.base_ref }} HEAD -- semantic_conventions/Rakefile | grep -q "SPEC_VERSION"; then | ||||||
| echo "changed=true" >> $GITHUB_OUTPUT | ||||||
| else | ||||||
| echo "changed=false" >> $GITHUB_OUTPUT | ||||||
| fi | ||||||
|
|
||||||
| - name: Regenerate semantic conventions | ||||||
| if: steps.check_changes.outputs.changed == 'true' | ||||||
| working-directory: semantic_conventions | ||||||
| run: bundle exec rake generate | ||||||
|
|
||||||
| - name: Commit and push changes | ||||||
| if: steps.check_changes.outputs.changed == 'true' | ||||||
| run: | | ||||||
| git config user.name "github-actions[bot]" | ||||||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||
| git add semantic_conventions/ | ||||||
| if git diff --staged --quiet; then | ||||||
| echo "No changes to commit" | ||||||
| else | ||||||
| git commit -m "chore: regenerate semantic conventions" | ||||||
| git push | ||||||
| fi | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some judicious local running of renovate validate and dry-run ...
This suggestion appears to be from the deprecation warning renovate emits about
regexManagers.(This PR's current config validation output)
One adjustment to @thompson-tomo's suggested changes, the regex in
managerFilePatternsought to be delimited with/es per the dep-warning's migration output. Dry-runs of the config with his changes did not work until I added those slashes.Why it doesn't get grumpy about the un-escaped
/in the middle, I have no idea. I suppose it might just be matching first-and-last slashes because it's not doing regex substitution. ¯\_(ツ)_/¯I'm 👍🏻 on this suggestion with the
/es added to wrap the regex.