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

build: set up GitHub app PRLint #9655

Merged
merged 1 commit into from May 12, 2020
Merged

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Apr 26, 2020

Sets up gitlint, which enforces Conventional Commits and sets up the proper post commit hook to enforce it.

Also modifying the PR template to remove redundant annoying checkbox section. Once we adopt, I'm hoping we can modify our bot to auto-label based on the commit type.

This requires a bit more discipline upfront, but should lead to a cleaner git log in master, meaning better release notes and such.

  • waiting for Apache infra to install PRLint Github App. JIRA

Sets up PRLint, with a single rule matching Conventional
Commits

Also modifying the PR template to remove redundant annoying checkbox section.

Once we adopt, I'm hoping we can modify our bot to auto-label based on the commit type.

@codecov-io
Copy link

codecov-io commented Apr 26, 2020

Codecov Report

Merging #9655 into master will increase coverage by 6.74%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9655      +/-   ##
==========================================
+ Coverage   64.03%   70.77%   +6.74%     
==========================================
  Files         532      587      +55     
  Lines       28897    30460    +1563     
  Branches     2758     3121     +363     
==========================================
+ Hits        18503    21558    +3055     
+ Misses      10211     8788    -1423     
+ Partials      183      114      -69     
Flag Coverage Δ
#cypress 53.66% <ø> (+<0.01%) ⬆️
#javascript 59.00% <ø> (?)
#python 70.93% <ø> (+0.37%) ⬆️
Impacted Files Coverage Δ
superset-frontend/src/setup/setupPlugins.ts 8.00% <0.00%> (-92.00%) ⬇️
superset/connectors/connector_registry.py 86.66% <0.00%> (-4.45%) ⬇️
superset/utils/pandas_postprocessing.py 88.32% <0.00%> (-1.98%) ⬇️
superset-frontend/src/setup/setupApp.ts 25.00% <0.00%> (-1.93%) ⬇️
superset/models/slice.py 83.78% <0.00%> (-1.78%) ⬇️
superset/db_engine_specs/mssql.py 93.02% <0.00%> (-1.10%) ⬇️
superset/models/core.py 86.13% <0.00%> (-0.73%) ⬇️
superset/views/core.py 75.13% <0.00%> (-0.12%) ⬇️
superset/security/manager.py 89.12% <0.00%> (-0.03%) ⬇️
superset/viz.py 71.49% <0.00%> (ø)
... and 228 more

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 5e4c291...12035bd. Read the comment docs.

@ktmud
Copy link
Member

ktmud commented Apr 26, 2020

FYI, superset-ui actually disabled commit lint recently, because we felt it's not really necessary given that we already had Semantic Pull Request check and will almost always do squash merge anyway.

Considering incubator-superset also only do squash merge, if this is to be added, would it be possible to enforce the checks only on the master branch?

@craig-rueda
Copy link
Member

Agree. I'm all for making the commit log more readable. Typically, when squashing, the commits that are actually being squashed are appended into the squash commit's message. Let's give it a shot...

@nytai
Copy link
Member

nytai commented Apr 26, 2020

I agree with @ktmud a per check would be preferable. We can even enforce semantic commits on the actual PR. A local pre-commit check seems like it could get annoying really quickly. I usually fixup my commits or reword them before opening a pr or when submitting pr for final review, especially given the commit messages get squashed into the commit that's finally merged. However, I commit often when developing locally for things like moving branches or commits I intend to fixup. Having to write a message that'll pass commit lint, not to mention running commit lint, when I just want to save my work and move to another branch seems tedious.

@mistercrunch
Copy link
Member Author

I agree local post-commit hook is heavy, there's a way to add a regex to skip something like wip.*.

It's true that ultimately with that "squash & merge" github policy it's the PR title that matters most. Maybe we force a PR title check to merge instead?

@mistercrunch
Copy link
Member Author

Oh! how about this: https://github.com/apps/prlint !?

@ktmud
Copy link
Member

ktmud commented Apr 28, 2020

Oh! how about this: github.com/apps/prlint !?

Looks legit! Seems more powerful than Semantic Pull Requests that superset-ui is using.

@dpgaspar
Copy link
Member

PRLint Looks good. Something like this would really help on patch releases and making the changelog more readable and parseable

@villebro
Copy link
Member

I like it!

@mistercrunch
Copy link
Member Author

@mistercrunch
Copy link
Member Author

Leaving open until https://issues.apache.org/jira/browse/INFRA-20236 closes

@mistercrunch mistercrunch changed the title chore: add support for gitlint: a commit msg linter chore: set up GitHub app PRLint May 7, 2020
@pull-request-size pull-request-size bot added size/S and removed size/L labels May 9, 2020
@mistercrunch mistercrunch changed the title chore: set up GitHub app PRLint build: set up GitHub app PRLint May 9, 2020
Sets up [PRLint](https://github.com/apps/prlint), with a single rule
matching [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/)

Also modifying the PR template to remove redundant annoying checkbox
section.

Once we adopt, I'm hoping we can modify our bot to auto-label based on
the commit type.
@mistercrunch
Copy link
Member Author

Alright I got Apache infra to install PRLint, with a single rule matching Conventional
Commits
and configured it in this PR!

We can add more rules around labeling, size, assignment, body, ... Worth checking out their docs to see what's possible.

@dpgaspar
Copy link
Member

awesome! let's merge it?

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

LGTM, we can iterate over this on subsequent PR's to add feature around labels etc...

@mistercrunch mistercrunch merged commit 65d185f into apache:master May 12, 2020
@@ -27,5 +16,3 @@ Choose one
- [ ] Confirm DB Migration upgrade and downgrade tested.
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API

### REVIEWERS
Copy link
Member

Choose a reason for hiding this comment

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

@mistercrunch why the removal of the reviewers section?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, you can just do this on the PR itself and get proper notifications related to that:
Screen Shot 2020-05-13 at 4 04 30 PM

The person opening the PR probably doesn't know who should review, so having this in the template makes outsiders feel even more that way.

There are ways to auto-assign based on which folders/modules are touched we could use in the future.

Copy link
Member

Choose a reason for hiding this comment

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

It seems only repo collaborators can request reviewers from there. Do all committers get notified when a new PR is created?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, we should add a feature to let anyone assign PRs through comments on the apache superset Github bot:
https://github.com/apache-superset/superset-github-bot

It can be a way to work around missing perms for contributors (non-committers).

The labeling feature broke recently for reasons I could not understand (felt like unicode-related around parsing the emoji). Spent 2 hours and gave up.

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants