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

Dangermattic Setup #518

Merged
merged 20 commits into from
Feb 13, 2024
Merged

Dangermattic Setup #518

merged 20 commits into from
Feb 13, 2024

Conversation

iangmaia
Copy link
Contributor

@iangmaia iangmaia commented Oct 6, 2023

What does it do?

Setting up the use of Dangermattic checks in the project, in addition to the already existing Danger setup. As Ruby 3 is a pre-requisite, this PR should be merged after #517.

These are the checks implemented:

  • Fail if Gemfile.lock version is different than version.rb (already existing)
  • Warn if CHANGELOG.MD hasn't been changed (already existing)
  • Rubocop via Danger
  • Gemfile / Gemfile.lock modified together check
  • Labels check
  • Diff size check
  • Milestone due date check
  • No reviewers check

How to test

You should see a comment stating the warnings / errors present in this PR. As a test, I've also added a "do not merge" label so that Danger also issues an error, and that error should also be reported on CI.

To run Danger yourself:

  1. Checkout this branch
  2. Run bundle install
  3. Run:
DANGER_GITHUB_API_TOKEN=<github_token> bundle exec danger pr <PR_URL>

You should get in the console the same errors / warnings reported in this PR.

Checklist before requesting a review

  • Run bundle exec rubocop to test for code style violations and recommendations
  • Add Unit Tests (aka specs/*_spec.rb) if applicable
  • Run bundle exec rspec to run the whole test suite and ensure all your tests pass
  • Make sure you added an entry in the CHANGELOG.md file to describe your changes under the appropriate existing ### subsection of the existing ## Trunk section.
  • If applicable, add an entry in the MIGRATION.md file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.

@dangermattic
Copy link
Collaborator

dangermattic commented Feb 1, 2024

2 Warnings
⚠️ Please add an entry in the CHANGELOG.md file to describe the changes made by this PR
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

Base automatically changed from update/ruby3 to trunk February 7, 2024 17:08
@iangmaia iangmaia added Do Not Merge e.g. if it depends on another PR to be merged first, or if that PR is only to trigger CI on forks, … and removed Do Not Merge e.g. if it depends on another PR to be merged first, or if that PR is only to trigger CI on forks, … labels Feb 8, 2024
@iangmaia iangmaia marked this pull request as ready for review February 8, 2024 14:56
@iangmaia iangmaia requested a review from a team February 8, 2024 15:18
.buildkite/pipeline.yml Outdated Show resolved Hide resolved
Dangerfile Outdated
Comment on lines 28 to 30
# Before checking the version, get rid of any change that `bundle install`
# might have done.
`git checkout Gemfile.lock &> /dev/null`
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Does this still make sense given that we have check_gemfile_lock_updated? In other words, if bundle install ends up changing the Gemfile.lock for some reason(†), wouldn't check_gemfile_lock_updated already error and fail at that point, meaning that we'll only get to that point if Gemfile.lock has not been modified by bundle install in the first place?

(†) Though maybe there are cases where the Gemfile.lock would be modified by bundle install that are not related to it not being up-to-date with Gemfile, but for other reasons… I'm especially thinking about the potential addition of a PLATFORMS entry…? 🤔

Copy link
Contributor Author

@iangmaia iangmaia Feb 8, 2024

Choose a reason for hiding this comment

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

Does this still make sense given that we have check_gemfile_lock_updated?

My first thought was: this won't hurt, so I just kept it. But at the same time, that being the case, it is also noise, so looking at it again, I'm now thinking of removing it 🤔

I'm especially thinking about the potential addition of a PLATFORMS entry…?

Good point, I think this can happen.

Comment on lines -3 to +5
## From `10.0.0` to `11.0.0`

- The new minimum required Ruby version is `3.2.2`. Please make sure to upgrade your projects before upgrading to this version to avoid compatibility issues.

## From `9.0.0` to `10.0.0`

- The new minimum required Ruby version is `3.2.2`. Please make sure to upgrade your projects before upgrading to this version to avoid compatibility issues.
Copy link
Contributor

@AliSoftware AliSoftware Feb 8, 2024

Choose a reason for hiding this comment

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

💭 I think the reason this was initially added under the from 10.0.0to11.0.0` section is that we maybe considered that the Ruby version bump would be a breaking change?

I mean, technically it is, because by definition a breaking change is when the new version of a dependency will require you to make (breaking) changes to your project before being able to adopt it. And indeed, updating the release-toolkit in your client projects will require you to update your projects to Ruby 3 (or ensure they've migrated already, while before the Ruby version requirement was lower).

It's always an open debate if things like that (Ruby version, or thinks like the Swift Version or target_deployment_version bumps for iOS pods, etc) should be taken into account when considering breaking changes and the need for a major version bumps.

So I'm open to the other POV of this not being considered a breaking change, especially since we are the sole users of this lib (I don't think anyone outside a8c uses release-toolkit 😛 ) and we know that all our clients of that lib (all our apps projects) have migrated to Ruby 3 (except maybe Simplenote… yet, due to its maintenance mode?), we just need to all agree on our stance on this.

Copy link
Contributor Author

@iangmaia iangmaia Feb 8, 2024

Choose a reason for hiding this comment

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

💭 I think the reason this was initially added under the from 10.0.0to11.0.0` section is that we maybe considered that the Ruby version bump would be a breaking change?

I actually see it as a breaking change (as, for example, it will break a Gem import if you're on Ruby 2.x), but in this case this move was a mistake from my side as I just added the 11.0.0 entry but didn't realize we're still on 9.x, going to 10.0.0 on the next release.

Copy link
Contributor

@AliSoftware AliSoftware Feb 8, 2024

Choose a reason for hiding this comment

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

Asked the team for their thoughts about it being considered breaking or not in our team channel, btw
p1707414498911939-C02KLTL3MKM-slack

Co-authored-by: Olivier Halligon <[email protected]>
@iangmaia iangmaia merged commit 6c808e5 into trunk Feb 13, 2024
5 checks passed
@iangmaia iangmaia deleted the add/dangermattic branch February 13, 2024 17:26
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.

3 participants