Coder Social home page Coder Social logo

jira-github-pr-check's People

Contributors

dependabot[bot] avatar sffc avatar srl295 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jira-github-pr-check's Issues

Add link to bot page from "single-commit" status

When the single-commit status fails, I've heard multiple times from multiple users that they don't realize that they can scroll down to the "jira-ticket" status to get to the details page that has the Squash Branch button. It might make it more discoverable if we add a link to the same page as "jira-ticket" from the "single-commit" status.

travis

add a basic travis that verifies that npm ci and the linter are working

Suggest certain PR types

When merging from a maint branch to master, the tool should remind the developer not to use the rebase-merge button. There does not appear to be a way for the tool to prevent the use of the rebase merge button, but at least it could leave a status that reminds the developer and makes the button non-green.

unicode-org/icu#539

Should you use a secret for inbound?

I don't know what 'creating a status is', but because there's a github credential, it might be good to use a secret (there's a field for it) in connecting to the webhook.

P1 Commit / PR validation: be more helpful

see also #30

jira-ticket — Commit message for 9d1c3e3 fails validation

… is not very helpful as to what should be present, especially for a message that does contain CLDR-15180 somewhere in it.

Proposal:

  • If a valid JIRA id (even on a loose match - match Cldr:15180 or similar) then suggest as follows:
Bad Commit message for 9d1c3e3:  'CLDR-15180 Describe the change here'

Describe the change here could be a static string, or could be calculated starting with the first alpha character.

That way if we get a message such as Cldr-15180 - /bin/sh was not found then it will instead say: CLDR-15180 bin/sh was not found (Extraneous: ' - /') - and show what part was causing the validation failure.

P1 Auto-approve PRs that are force-pushed

Context: https://github.community/t5/How-to-use-Git-and-GitHub/Auto-approve-force-pushes-if-PR-was-already-approved/m-p/15029/thread-id/4672

The checker tool should be able to detect when the only change to a PR was a force-push to squash, edit commit message, etc., and it should automatically re-approve the PR.

If not auto-approve, the bot should at least leave a comment saying that the code is the same, so that the human reviewer doesn't have to take that on faith.

@srl295

Update JIRA ticket with status on merge

@sffc this is somewhat of a question.

  • Does the pr-check get notified when a PR is merged?

Context: https://unicode-org.atlassian.net/browse/CLDR-15400

There's sometimes confusion when a PR or commit mentions a JIRA ticket but isn't targetted at that ticket. xrefs are super helpful, but can add noise. (I filed this ticket to try to avoid needing some kind of policy that restricts mentioning other tickets.)

Jira's "developer" field isn't really a field, you can't really search for "Tickets that have commits" and even if you could, you don't know if the ticket was really fixed by the PR or just mentioned by it.

If pr-check gets notified on merge, then it could actually update a Jira field, something like "mergedIn".

  • For branch maint/maint-43 it could definitely add maint-43 to mergedIn.
  • For branch main it could add main to mergedIn

More advanced:

  • We could somehow use the current version logic to actually use the "targeted release version" for that branch for the mergedIn field.
  • mergedIn should be a list, not a singleton, because of cherry picks.

Add squashing tool

The tool should have a button from the PR error page that fixes up the commit messages for you and overwrites the branch with a squash commit, where the commit message is the PR title. The tool can ask the user for OAuth write permission to their repository and perform the fix in one or two clicks.

@srl295

P3 PR title: automatically fix

See #37 referring to #36

If the PR title is something like Cldr-1234 - Something Here could the checker actually modify the PR title and change it to CLDR-1234 Something Here automatically?

make exceptions human readable

a3de9a3 supports DISABLE_JIRA_ISSUE_MATCH=true

Instead, how about something like this:

DisableJiraIssueMatch: because this is a merge from the maint branch

In other words, a special token at the beginning, and then a required description.

Can text follow DISABLE_JIRA_ISSUE_MATCH=true? Then:

DISABLE_JIRA_ISSUE_MATCH=true: because this is a merge from the maint branch

would work. but a human readable description is important.

Bot should ignore draft pull requests

When a PR is in early development, the bot can be noisy. Given that the bot's primary purpose is to help with code reviews, there should be an option (or perhaps make it the default behavior) to suppress notifications if a PR is in Draft state.

CC @Manishearth

Improve handling of multiple authors

Currently if two authors push to a branch, it looks like jira-github-pr-check squashes to a commit attributed to the last author. A small fix by a reviewer can thus result in the reviewer getting full blame - thus discouraging direct fixes.

Options:

  • refusing to squash when there's more than one author?
  • using the first author, not the last?
  • or at least warning very clearly when there's more than one?
  • some way of explicitly choosing which author?
  • (only squashing successive commits by the same author?) <- not recommended, when the same author might also commit with different email addresses. And the end-result isn't a single commit.

I like the first option above: I think it's reasonable to just let people squash manually when there's more than one author.

Add support for non-public Jira tickets

Right now, the check is wired up for only public tickets; there is no authentication to Jira. This means that tickets not viewable publicly, such as those with "sensitive" security level. It's unclear whether this is a bug or a feature.

@markusicu @srl295

Should not modify closed PRs

If the state of a ticket changes after the PR is merged, the check status should continue to reflect the state at the time of merging. To fix this, the checker should not be able to modify PRs that have been merged or closed.

Require PR owner?

Should the bot also require a PR owner?

Upside is that ownership shows up earlier in lists of PRs.

Downside is that community contributions, that might otherwise pass tests, will show with an X as broken when they might be otherwise OK.

doc: scope

# Option 1: Personal Access Token; easiest and useful for testing.
# Create one of these from https://github.com/settings/tokens
GITHUB_TOKEN=xxxxxxxxxx

I'm guessing repo:status scope is what's needed?

slashes confuse the checker?

over on unicode-org/cldr#1085 the following text failed both PR title and Commit title validation:

  • CLDR-14395 /api/auth endpoints

with "PR must begin with a Jira ticket ID" etc.

Changing to CLDR-14395 API for … fixed it. Something with slashes?

please rename the default branch of this repo from "master" to "main"

I believe that this is now the last of the unicode-org repos which is still using "master". (Except for archived repos.)
According to the notes on our tracking spreadsheet, this was tried before and "changed back to master due to GCP bug".
Could someone please look at what bug that was and whether we can get past it now?

@srl295 @sffc

Dockerize

add a simple docker file to simplify deployment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.