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: ensure title matches Conventional Commits spec #187

Merged
merged 5 commits into from
Apr 26, 2023
Merged

Conversation

deepyaman
Copy link
Member

@deepyaman deepyaman commented Apr 24, 2023

Description

Challenges

[...]

  • It's not clear which changes affect which plugins
    • Denoted inconsistently using tags like [kedro-docker] on PR/issues (nonstandard solution)

Proposal

[...]

Originally posted by @deepyaman in kedro-org/kedro#2333 (comment)

Development notes

Tested manually. Also, have used the Action on other projects previously. The configuration is pretty much that documented in the Action's repo.

Can somebody with rights ensure that the squash-merge strategy IS NOT set to use the commit message if there's only one commit? See https://github.com/amannn/action-semantic-pull-request#installation.

Is there (going to be) a CONTRIBUTING.md for this repo? If so, we can include the following:

Pull request title conventions

The Kedro-Plugins repository requires that you squash and merge your pull request commits, and, in most cases, the merge message for a squash merge then defaults to the pull request title.

Your pull request title must match the Conventional Commits spec. Also see the list of supported commit types and their descriptions. Commit scope can be one of the plugin names.

Examples

Commit message with no body

ci: port lint, unit test, and e2e tests to Actions

Commit message with scope

build(datasets): add the missing `snowflake` extra

Checklist

  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the relevant RELEASE.md file
  • Added tests to cover my changes

@deepyaman deepyaman changed the title Create validate-pr-title.yaml [WIP] Create validate-pr-title.yaml Apr 24, 2023
@deepyaman deepyaman marked this pull request as ready for review April 24, 2023 16:29
@noklam
Copy link
Contributor

noklam commented Apr 24, 2023

👀How Is this gonna work does it reject invalid pr immediately?

@noklam
Copy link
Contributor

noklam commented Apr 24, 2023

Ah I guess it will be just another check, so it won't prevent people from opening invalid PR but just blocking the merge of it.

What is a valid PR title here?

@deepyaman
Copy link
Member Author

deepyaman commented Apr 24, 2023

Ah I guess it will be just another check, so it won't prevent people from opening invalid PR but just blocking the merge of it.

What is a valid PR title here?

Yes, correct. I would follow the Conventional Commits specification, with scope as one of airflow, datasets, docker, etc.

(Also, sorry, it's still WIP; I just marked it as ready to trigger CI!)

@deepyaman deepyaman marked this pull request as draft April 24, 2023 20:00
@deepyaman deepyaman marked this pull request as ready for review April 24, 2023 20:05
@deepyaman deepyaman changed the title [WIP] Create validate-pr-title.yaml ci: ensure title matches Conventional Commits spec Apr 24, 2023
@deepyaman deepyaman marked this pull request as draft April 24, 2023 20:20
@deepyaman deepyaman changed the title ci: ensure title matches Conventional Commits spec ci(invalid-scope): ensure title matches Conventional Commits spec Apr 25, 2023
@deepyaman deepyaman changed the title ci(invalid-scope): ensure title matches Conventional Commits spec ci(telemetry): ensure title matches Conventional Commits spec Apr 25, 2023
@deepyaman deepyaman changed the title ci(telemetry): ensure title matches Conventional Commits spec ci: ensure title matches Conventional Commits spec Apr 25, 2023
@deepyaman deepyaman marked this pull request as ready for review April 25, 2023 17:14
@deepyaman deepyaman self-assigned this Apr 25, 2023
Copy link
Contributor

@noklam noklam left a comment

Choose a reason for hiding this comment

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

I checked to see if it's possible to have a PR title in the template, it doesn't seem to be possible. The rules are simple enough so I think it's ok.
isaacs/github#1252

Question:

  • What about commit doesn't fall into these scope? Like CI, i.e. is this PR itself regard as a valid commit?

p.s. I think we should have a CONTRIBUTOR.md here.

@deepyaman deepyaman enabled auto-merge (squash) April 25, 2023 19:09
@deepyaman
Copy link
Member Author

deepyaman commented Apr 25, 2023

  • What about commit doesn't fall into these scope? Like CI, i.e. is this PR itself regard as a valid commit?

Yep! I didn't require a scope, because (like you pointed out) not all PRs will apply to just one plugin.

p.s. I think we should have a CONTRIBUTOR.md here.

Totally agree, and I'd even be happy to start one off with just the guidelines above + some stuff copied over from the Kedro/Kedro-Viz CONTRIBUTING.md? I'm not 100% sure what it should look like, so maybe it's better I leave it out of this PR. On a separate note, it may also make sense to not maintain separate CONTRIBUTING.md for each repo (e.g. with Code of Conduct, etc.).

@noklam
Copy link
Contributor

noklam commented Apr 25, 2023

Yep! I didn't require a scope, because (like you pointed out) not all PRs will apply to just one plugin.

How are we dealing with it? I am seeing the checking failed for this PR

@deepyaman
Copy link
Member Author

Yep! I didn't require a scope, because (like you pointed out) not all PRs will apply to just one plugin.

How are we dealing with it? I am seeing the checking failed for this PR

Where? I'm seeing it passed. 😅 I did modify it to "ci(invalid-scope): ensure title matches Conventional Commits spec" at some point before, so maybe the failure is associated with that?

Copy link
Contributor

@ankatiyar ankatiyar left a comment

Choose a reason for hiding this comment

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

+1 on adding a CONTRIBUTING.md here but also might be worth adding a note in the PR template itself so people can see it when they open the PR - like we did for kedro repository when we moved kedro-datasets

@deepyaman deepyaman merged commit d6d1e90 into main Apr 26, 2023
@deepyaman deepyaman deleted the deepyaman-patch-2 branch April 26, 2023 09:56
dannyrfar pushed a commit to dannyrfar/kedro-plugins that referenced this pull request May 3, 2023
* Create validate-pr-title.yaml

* ci: add `ready_for_review` to the PR type triggers

* Update validate-pr-title.yaml

* revert: drop the `ready_for_review` type from list

* ci: restrict the set of scopes to the plugin names

Signed-off-by: Danny Farah <danny_farah@mckinsey.com>
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.

3 participants