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

Publish via Trusted Publishing #4315

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TonyCTHsu
Copy link
Contributor

@TonyCTHsu TonyCTHsu commented Jan 23, 2025

What does this PR do?

Publish to rubygems.org via Trusted Publishing

Ref: https://guides.rubygems.org/trusted-publishing/

Change log entry
None.

@TonyCTHsu TonyCTHsu added dev/tooling Involves tools (e.g. Rubocop, CodeCov) do-not-merge/WIP Not ready for merge dev/github Github repository maintenance and automation labels Jan 23, 2025
steps:
- name: Download from RubyGems
run: |
gem fetch datadog --version ${GEM_VERSION} --verbose
Copy link
Member

Choose a reason for hiding this comment

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

Should it wait for gem presence? Sometimes it's not immediately available because - I presume - of some internal propagation (mirror/CDN/caching).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is already done by the previous job.

The last step run gem exec rubygems-await pkg/*.gem , which the logs look like

2025-01-23 13:24:26 +0000 I              Awaiting tobee-0.1.2 on https://rubygems.org/
2025-01-23 13:24:26 +0000 I [ pre index] all found!
2025-01-23 13:24:26 +0000 I [full index] missing: tobee-0.1.2
2025-01-23 13:24:26 +0000 I [      gems] missing: tobee-0.1.2
2025-01-23 13:24:26 +0000 I [  gemspecs] missing: tobee-0.1.2
2025-01-23 13:24:26 +0000 I [      info] missing: tobee (tobee-0.1.2)
2025-01-23 13:24:26 +0000 I [     names] missing: tobee
2025-01-23 13:24:26 +0000 I [  versions] missing: tobee (tobee-0.1.2)
2025-01-23 13:24:27 +0000 I [  gemspecs] found tobee-0.1.2
2025-01-23 13:24:27 +0000 I [  gemspecs] all found!
2025-01-23 13:24:27 +0000 I [      gems] found tobee-0.1.2
2025-01-23 13:24:27 +0000 I [      gems] all found!
2025-01-23 13:24:28 +0000 I [      info] missing: tobee (tobee-0.1.2)
2025-01-23 13:24:29 +0000 I [     names] found tobee
2025-01-23 13:24:29 +0000 I [     names] all found!
2025-01-23 13:24:29 +0000 I [      info] found tobee-0.1.2
2025-01-23 13:24:29 +0000 I [      info] all found!
2025-01-23 13:24:30 +0000 I [  versions] missing: tobee (tobee-0.1.2)
2025-01-23 13:24:[39](https://github.com/TonyCTHsu/tobee/actions/runs/12930149327/job/36061017279#step:5:44) +0000 I [full index] missing: tobee-0.1.2
2025-01-23 13:24:40 +0000 I [  versions] found tobee-0.1.2
2025-01-23 13:24:[40](https://github.com/TonyCTHsu/tobee/actions/runs/12930149327/job/36061017279#step:5:45) +0000 I [  versions] all found!
2025-01-23 13:24:51 +0000 I [full index] missing: tobee-0.1.2
2025-01-23 13:25:00 +0000 I [full index] found tobee-0.1.2
2025-01-23 13:25:00 +0000 I [full index] all found!
2025-01-23 13:25:00 +0000 I              Found tobee-0.1.2

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Jan 23, 2025

Datadog Report

Branch report: tonycthsu/trusted-publishing
Commit report: de8d2c7
Test service: dd-trace-rb

✅ 0 Failed, 22101 Passed, 1476 Skipped, 5m 3.46s Total Time

- id: version
run: |
echo "version=$(ruby -e 'puts Gem::Specification::load(Dir.glob("*.gemspec").first).version')" >> $GITHUB_OUTPUT
- uses: rubygems/release-gem@v1
Copy link
Member

Choose a reason for hiding this comment

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

So:

  • the rubygems/release-gem action creates the tag
  • which then ends up triggering GitLab CI
  • which waits for the gem to be found on rubygems and uses that

Worth a comment outlining this possibly surprising† behaviour here!

† To someone only concerned by GHA and unaware of SSI CI implementation.

.gitlab-ci.yml Show resolved Hide resolved
@pr-commenter
Copy link

pr-commenter bot commented Jan 23, 2025

Benchmarks

Benchmark execution time: 2025-01-24 23:24:08

Comparing candidate commit de8d2c7 in PR branch tonycthsu/trusted-publishing with baseline commit 8818eb8 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics.

@TonyCTHsu TonyCTHsu force-pushed the tonycthsu/trusted-publishing branch from 68a23bc to c8d46b6 Compare January 23, 2025 16:15
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.72%. Comparing base (8818eb8) to head (de8d2c7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4315      +/-   ##
==========================================
- Coverage   97.72%   97.72%   -0.01%     
==========================================
  Files        1365     1365              
  Lines       82780    82780              
  Branches     4206     4206              
==========================================
- Hits        80897    80893       -4     
- Misses       1883     1887       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TonyCTHsu TonyCTHsu force-pushed the tonycthsu/trusted-publishing branch from c8d46b6 to 0916911 Compare January 24, 2025 14:28
@TonyCTHsu TonyCTHsu removed the do-not-merge/WIP Not ready for merge label Jan 24, 2025
@TonyCTHsu TonyCTHsu marked this pull request as ready for review January 24, 2025 14:48
@TonyCTHsu TonyCTHsu requested a review from a team as a code owner January 24, 2025 14:48
.github/workflows/publish.yml Outdated Show resolved Hide resolved
.github/workflows/publish.yml Show resolved Hide resolved
.gitlab-ci.yml Show resolved Hide resolved
Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

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

just marking as request changes only because I accidentally hit approve 😓

@brettlangdon brettlangdon dismissed their stale review January 24, 2025 17:07

Not actually blocking anything.

Copy link
Member

@p-datadog p-datadog left a comment

Choose a reason for hiding this comment

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

I read the diff and have no objections, thtough I'll leave it to someone else to apply the checkmark.

.github/workflows/publish.yml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/github Github repository maintenance and automation dev/tooling Involves tools (e.g. Rubocop, CodeCov)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants