Skip to content
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

feat: add api release preparation scripts, github release creation scripts #4704

Merged
merged 7 commits into from
May 21, 2024

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented May 14, 2024

Which problem is this PR solving?

Adds a few more script for release-automation that I usually did by hand. Moving us closer to having a fully-automated solution.
This adds:

  • automatic minor version bumps for API releases
    • we only had Experimental/Stable changes automated previously. We cannot use lerna for this as there's no way to just bump the API package and have it widen the < version ranges. Before this I used to manually update all dependencies, which was error-prone and tedious.
    • this adds the script to align the dependencies to each package so that we can call it via lerna
  • a restriction on how API dependencies can be written to simplify the automatic version bumps from the script mentioned above:
    • A.B.C is allowed
    • ^A.B.C is allowed (default for instrumentation packages)
    • >=A.B.C <X.Y.Z is allowed (default for SDK packages)
  • script to automatically create draft github releases
    • this was also done manually, by manually copying from the respective CHANGELOG.md (up to 3 times per release), manually typing the release title and manually creating a tag.
  • script to automate updating api/CHANGELOG.md

PR creation, publishing packages and publishing Github Releases remains manual.

Additional changes:

  • adds peer-api-check to some packages where it was missing
  • aligns headings in api/CHANGELOG.md to avoid having them removed by the automatic updating of api/CHANGELOG.md

Next steps:

  • scripts to automatically create a release PRs
  • automatically create release PRs via @opentelemetrybot
  • scripts to automatically push to npm when a release PR is merged

How Has This Been Tested?

  • Manual testing

@@ -97,13 +97,13 @@ All notable changes to this project will be documented in this file.

* export tracer options ([#154](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/154)) ([b125324](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/b125324438fb2f24eb80c7c6673afc8cfc99575e))

### [1.0.4](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.3...v1.0.4) (2021-12-18)
## [1.0.4](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.3...v1.0.4) (2021-12-18)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer note: empty ### sections are removed by the changelog prep script, so I'm aligning them here to ensure they don't get removed.

@pichlermarc pichlermarc marked this pull request as ready for review May 14, 2024 14:52
@pichlermarc pichlermarc requested a review from a team as a code owner May 14, 2024 14:52
@pichlermarc pichlermarc changed the title feat: add more release scripts feat: add api release preparation scripts, github release creation scripts May 15, 2024
Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple nits.

const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));

if(packageJson.private === true || packageJson.private === 'true'){
console.log('Skipping version from private package at', packageJsonPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Do you want these warning/error cases to use console.warn so they go to stderr perhaps? Otherwise, if you hit the accidental error case, then npm run _github:draft_release:* could result in weird args being sent to gh release create ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good point. We wouldn't want that.

0d131ce f1cc172:

  • added a check for the returned value (verifying that it's a version, leaving it empty in the draft release if it is not a version)
  • changed the console.log to console.warn

scripts/extract-latest-release-notes.js Outdated Show resolved Hide resolved
const fs = require('fs');

const changelog = fs.readFileSync(process.argv[2]).toString();
const firstReleaseNoteEntryExp = /^## \d+\.\d+\.\d\n.*?(?=^## )/ms;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment describing the regex for future explorers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, great idea: cf2f079 5cbeef9

Copy link

linux-foundation-easycla bot commented May 17, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@pichlermarc
Copy link
Member Author

/easycla

@pichlermarc pichlermarc merged commit bac68fc into open-telemetry:main May 21, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants