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

ci: allow revert PRs #1740

Closed
wants to merge 5 commits into from

Conversation

buneeIsSlo
Copy link

Fixes #1486

Update PR linter to ignore commit messages beginning with Revert

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2023

⚠️ No Changeset found

Latest commit: 0bc1986

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

.commitlintrc Outdated
"extends": ["@commitlint/config-conventional"]
"extends": ["@commitlint/config-conventional"],
"ignores": [
(commit) => commit.startsWith("Revert ")
Copy link
Member

@holic holic Oct 11, 2023

Choose a reason for hiding this comment

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

this looks like JS - should we rename the file to clarify and get better IDE integration?

my preference would be commitlint.config.ts (https://github.com/conventional-changelog/commitlint#config)

Copy link
Author

@buneeIsSlo buneeIsSlo Oct 11, 2023

Choose a reason for hiding this comment

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

Yes, I can do that. Are there any other changes I need to make?

Copy link
Member

Choose a reason for hiding this comment

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

nope, I think that's it

Copy link
Author

Choose a reason for hiding this comment

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

Hi, I'm unable to import the types needed for this action. Do you have any idea why?

commitlint

Copy link
Author

Choose a reason for hiding this comment

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

@holic I would truly appreciate some help here.

Copy link
Member

Choose a reason for hiding this comment

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

have you installed @commitlint/types as a new dependency?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @alvrs, when I tried to install the dependency before, I encountered an error message that went something like pnpm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see.... I switched to a different IDE, and now I get an entirely different message. Am I not supposed to install the dependency in the root folder?

Copy link
Author

Choose a reason for hiding this comment

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

I got it to work. Please review the changes.

@buneeIsSlo buneeIsSlo requested a review from holic October 13, 2023 13:33
@@ -1683,6 +1687,13 @@ packages:
prettier: 2.8.4
dev: true

/@commitlint/types@17.4.4:
Copy link
Member

Choose a reason for hiding this comment

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

looks like this got added to the lockfile but not to package.json

did you use pnpm add to add this? try pnpm add -D -w @commitlint/types

Copy link
Author

Choose a reason for hiding this comment

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

@holic I did use pnpm add. I ran the command, and it updated the lock file, but there were no changes in the package.json :( Am I missing something?

@holic holic changed the title ci: update pr linter to allow reverts (#1486) ci: update pr linter to allow reverts Oct 15, 2023
@holic holic changed the title ci: update pr linter to allow reverts ci: allow revert PRs Oct 15, 2023
@holic holic changed the title ci: allow revert PRs Revert "ci: allow revert PRs" Oct 15, 2023
@holic holic marked this pull request as draft October 15, 2023 14:40
@holic
Copy link
Member

holic commented Oct 15, 2023

weird, I updated the PR title but wasn't able to get this to pass with the new config

I dug in a bit more and looks like the default rules should already ignore revert messages of this shape:
https://github.com/conventional-changelog/commitlint/blob/786ecb4037d343251f43f25957af563907db2634/%40commitlint/is-ignored/src/defaults.ts#L22

@holic
Copy link
Member

holic commented Oct 15, 2023

Looks like this is specifically related to the CI action we use to validate PR titles, not commitlint config:
https://github.com/latticexyz/mud/blob/main/.github/workflows/pr.yml#L15
amannn/action-semantic-pull-request#192 (comment)

@holic holic changed the title Revert "ci: allow revert PRs" ci: allow revert PRs Oct 15, 2023
@holic
Copy link
Member

holic commented Oct 15, 2023

Going to close this for now as I think this requires some upstream fixes or replacing our CI step with another approach. Thanks for the attempt!

Feel free to open another PR if you want to take another stab at this using a different approach.

@holic holic closed this Oct 15, 2023
@buneeIsSlo buneeIsSlo deleted the bunee-update-pr-linter branch October 15, 2023 16:50
@buneeIsSlo
Copy link
Author

@holic I understand, no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update PR linter to allow reverts
3 participants