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

Improve gem deployment #2152

Merged
merged 7 commits into from Mar 5, 2022
Merged

Improve gem deployment #2152

merged 7 commits into from Mar 5, 2022

Conversation

zephraph
Copy link
Collaborator

@zephraph zephraph commented Mar 2, 2022

What Changed

Updates writeNewVersion for the gem plugin to also bump the version in the lock file and go ahead and commit it. Also refactors the gem plugin tests not to mock out fs.readFile, etc in favor of using mock-fs.

Why

I've been hitting an issue (see below) that prevents me from deploying today where bundle exec rake build fails b/c the lock file has changed. It seems like this is some strict mode that is utilized in the GitHub actions environment. In the plugin we previously held off on committing the version change b/c the build would update the lockfile. This is basically b/c it's updating the package version that's also referenced in the lockfile. I went ahead and added that as a part of the writeNewVersion function. The benefit here is that it should be clean in an expected way when bundle exec rake build runs. If it's not it really is a problem that would need to be addressed by the gem author.

Error: Running command 'bundle' with args [exec, rake, build] failed

bundler: failed to load command: rake (/home/runner/work/asciidoctor-mermaid/asciidoctor-mermaid/vendor/bundle/ruby/2.7.0/bin/rake)
/opt/hostedtoolcache/Ruby/2.7.5/x64/lib/ruby/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/definition.rb:397:in `ensure_equivalent_gemfile_and_lockfile': You are trying to install in deployment mode after changing (Bundler::ProductionError)
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

Todo:

  • Add tests
  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

🐤 Download canary assets:

auto-linux--canary.2152.25627.gz
auto-macos--canary.2152.25627.gz
auto-win.exe--canary.2152.25627.gz

📦 Published PR as canary version: under canary scope @auto-canary@10.34.0--canary.2152.25627.0

✨ Test out this PR locally via:

npm install @auto-canary/bot-list@10.34.0--canary.2152.25627.0
npm install @auto-canary/auto@10.34.0--canary.2152.25627.0
npm install @auto-canary/core@10.34.0--canary.2152.25627.0
npm install @auto-canary/package-json-utils@10.34.0--canary.2152.25627.0
npm install @auto-canary/all-contributors@10.34.0--canary.2152.25627.0
npm install @auto-canary/brew@10.34.0--canary.2152.25627.0
npm install @auto-canary/chrome@10.34.0--canary.2152.25627.0
npm install @auto-canary/cocoapods@10.34.0--canary.2152.25627.0
npm install @auto-canary/conventional-commits@10.34.0--canary.2152.25627.0
npm install @auto-canary/crates@10.34.0--canary.2152.25627.0
npm install @auto-canary/docker@10.34.0--canary.2152.25627.0
npm install @auto-canary/exec@10.34.0--canary.2152.25627.0
npm install @auto-canary/first-time-contributor@10.34.0--canary.2152.25627.0
npm install @auto-canary/gem@10.34.0--canary.2152.25627.0
npm install @auto-canary/gh-pages@10.34.0--canary.2152.25627.0
npm install @auto-canary/git-tag@10.34.0--canary.2152.25627.0
npm install @auto-canary/gradle@10.34.0--canary.2152.25627.0
npm install @auto-canary/jira@10.34.0--canary.2152.25627.0
npm install @auto-canary/magic-zero@10.34.0--canary.2152.25627.0
npm install @auto-canary/maven@10.34.0--canary.2152.25627.0
npm install @auto-canary/microsoft-teams@10.34.0--canary.2152.25627.0
npm install @auto-canary/npm@10.34.0--canary.2152.25627.0
npm install @auto-canary/omit-commits@10.34.0--canary.2152.25627.0
npm install @auto-canary/omit-release-notes@10.34.0--canary.2152.25627.0
npm install @auto-canary/pr-body-labels@10.34.0--canary.2152.25627.0
npm install @auto-canary/released@10.34.0--canary.2152.25627.0
npm install @auto-canary/s3@10.34.0--canary.2152.25627.0
npm install @auto-canary/sbt@10.34.0--canary.2152.25627.0
npm install @auto-canary/slack@10.34.0--canary.2152.25627.0
npm install @auto-canary/twitter@10.34.0--canary.2152.25627.0
npm install @auto-canary/upload-assets@10.34.0--canary.2152.25627.0
npm install @auto-canary/vscode@10.34.0--canary.2152.25627.0
# or 
yarn add @auto-canary/bot-list@10.34.0--canary.2152.25627.0
yarn add @auto-canary/auto@10.34.0--canary.2152.25627.0
yarn add @auto-canary/core@10.34.0--canary.2152.25627.0
yarn add @auto-canary/package-json-utils@10.34.0--canary.2152.25627.0
yarn add @auto-canary/all-contributors@10.34.0--canary.2152.25627.0
yarn add @auto-canary/brew@10.34.0--canary.2152.25627.0
yarn add @auto-canary/chrome@10.34.0--canary.2152.25627.0
yarn add @auto-canary/cocoapods@10.34.0--canary.2152.25627.0
yarn add @auto-canary/conventional-commits@10.34.0--canary.2152.25627.0
yarn add @auto-canary/crates@10.34.0--canary.2152.25627.0
yarn add @auto-canary/docker@10.34.0--canary.2152.25627.0
yarn add @auto-canary/exec@10.34.0--canary.2152.25627.0
yarn add @auto-canary/first-time-contributor@10.34.0--canary.2152.25627.0
yarn add @auto-canary/gem@10.34.0--canary.2152.25627.0
yarn add @auto-canary/gh-pages@10.34.0--canary.2152.25627.0
yarn add @auto-canary/git-tag@10.34.0--canary.2152.25627.0
yarn add @auto-canary/gradle@10.34.0--canary.2152.25627.0
yarn add @auto-canary/jira@10.34.0--canary.2152.25627.0
yarn add @auto-canary/magic-zero@10.34.0--canary.2152.25627.0
yarn add @auto-canary/maven@10.34.0--canary.2152.25627.0
yarn add @auto-canary/microsoft-teams@10.34.0--canary.2152.25627.0
yarn add @auto-canary/npm@10.34.0--canary.2152.25627.0
yarn add @auto-canary/omit-commits@10.34.0--canary.2152.25627.0
yarn add @auto-canary/omit-release-notes@10.34.0--canary.2152.25627.0
yarn add @auto-canary/pr-body-labels@10.34.0--canary.2152.25627.0
yarn add @auto-canary/released@10.34.0--canary.2152.25627.0
yarn add @auto-canary/s3@10.34.0--canary.2152.25627.0
yarn add @auto-canary/sbt@10.34.0--canary.2152.25627.0
yarn add @auto-canary/slack@10.34.0--canary.2152.25627.0
yarn add @auto-canary/twitter@10.34.0--canary.2152.25627.0
yarn add @auto-canary/upload-assets@10.34.0--canary.2152.25627.0
yarn add @auto-canary/vscode@10.34.0--canary.2152.25627.0

@intuit-svc intuit-svc added the minor Increment the minor version when merged label Mar 2, 2022
@codecov
Copy link

codecov bot commented Mar 2, 2022

Codecov Report

Merging #2152 (4c667df) into main (b63ef24) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2152      +/-   ##
==========================================
+ Coverage   80.21%   80.30%   +0.09%     
==========================================
  Files          66       66              
  Lines        5422     5423       +1     
  Branches     1268     1270       +2     
==========================================
+ Hits         4349     4355       +6     
+ Misses        710      708       -2     
+ Partials      363      360       -3     
Impacted Files Coverage Δ
plugins/gem/src/index.ts 83.33% <100.00%> (+3.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4ac2d4...4c667df. Read the comment docs.

@zephraph
Copy link
Collaborator Author

zephraph commented Mar 5, 2022

I validated this latest version worked by publishing https://rubygems.org/gems/asciidoctor-mermaid. The repo isn't public yet, but I'll open it up soon.

@zephraph zephraph merged commit b1f048d into main Mar 5, 2022
@zephraph zephraph deleted the improve-gem-deployment branch March 5, 2022 08:37
@intuit-svc
Copy link

🚀 PR was released in v10.34.0 🚀

@intuit-svc intuit-svc added the released This issue/pull request has been released. label Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants