Giter Site home page Giter Site logo

gh-action-lt-backlog's Introduction

Actions to automate GitHub backlog and Kanban

Versioning

master

Master contains current development work and should not be used by production templates.

Reviewed changes should be tested on master branch before their release to a versioned branche.

v1, v2, ... vn

Versioned release branches. Always use latest. Extensions are allowed, breaking changes requires creation of a new version branch.

All actions should be consumed from these branches.

Actions

AssignCardToSender - Assign Kanban card to sender of the event, mainly when moving card from To do column.

CopyLabelToPR - Copy configured labels from all mentioned issues to PR.

CreateCardForIssue - Create card for issue, mainly when milestoned.

CreateCardForIssueFromLabel - Create card for issue in a project column determined by the issue label. Mainly to organize backlog project.

CreateCardForStandalonePR - Create card for Standalone PR in In progress column.

CreateNote - Create a card with a note in the configured Kanban column.

CreateRspecIssue - Create issue to update RSPEC after milestone is created.

LogPayload - Log payload to console

MoveCardAfterReview - Move card back to In Progress or to Review approved column after review.

MoveCardToReview - Move card to Review in progress when PR author asks for a review.

ToggleLockBranch - Lock or Unlock branch to prevent merge of PRs.

Development notes

Run Octokit action from PowerShell:

This syntax allows setting environment variables with hyphens in the name:

${env:GITHUB_REPOSITORY}="SonarSource/<YourRepoName>"
${env:INPUT_GITHUB-TOKEN}="ghp_...."
${env:INPUT_PARAM}="True"
${env:INPUT_PARAM-NAME-WITH-HYPHEN}="Value"
clear; node .\dist\ActionName\ActionName.js

gh-action-lt-backlog's People

Contributors

cristian-ambrosini-sonarsource avatar ilia-kebets-sonarsource avatar julien-carsique-sonarsource avatar malena-ebert-sonarsource avatar pavel-mikula-sonarsource avatar

Stargazers

 avatar

Watchers

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

Forkers

isabella232

gh-action-lt-backlog's Issues

Docs: How to find project ID

Add comemnt to IssueLabeled, that project ID can be found here

curl -u <login>:<token> https://api.github.com/repos/SonarSource/<repo-name>/projects

Don't assign to a group

When review is requested from a group, assignees should not change.

Ask review from group

    Processing PR: #5464
    Removing assignees: vilchik-elena
    Done
    TypeError: Cannot read property 'login' of undefined
    Error: Unhandled error: TypeError: Cannot read property 'login' of undefined
        at processIssue (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v4.0.2/dist/index.js:2451:56), <anonymous>:62:61)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

Create build pipeline

Cross-compiled JS files needs to be checked in the PRs and repostiroy in general.

We need .cirrus.yml action that will fail the pipeline in case any changes are done by node build

Link PRs to issues for non-default branches

When Fixes #xxx is added to a PR, GH automatically links the issue in Development section on the right. This ONLY works when the PR targets the master branch, see:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

The pull request must be on the default branch.

We should automate the mapping for non-default repo branch.

ToDo:

  • Find the limit of mapped PRs, make the implementation resilient in case we reach the limit.
  • Verify, if the issue is automatically closed or not. If not, close it when PR is merged.

Configure actions by column name

We almost always create projects and load column list now. So we don't need to have column-id as input, column name should be enough.

ToDo:

  • Verify that this makes sense for all the action
  • Let column names like In Progress be used as the input value for column-id
  • When project-number is set, use v2. Otherwise, consider it v1
  • Update docs everywhere

Add Sprint: label to partial PR

When a PR is one part of an umbrella issue, it should be decorated with the same Sprint: label as the umbrella issue when created.
Contrary to Fixes (and similar) links, this link should be inferred from any reference to the umbrella issue. Like Part of #xxx or Contributes to #xxxx and so on.

The Sprint: prefix should be configurable, with Sprint: as a default value.

Enforce squash merge

We need an action or hook that will block merging of a PR after "Rebase and merge" button was clicked and PR was not from a feature/* branch.

Equally, when a feature branch is merged, it should not be possible to Squash the commits.

Why?

Normally, we use "Squash and merge" for every single PR.
When we need to merge a feature branch, we need to use "Rebase and merge" button.
Unfortunately, GitHub UI will remember that option for the user who merged the feature branch.
And with the very next PR, it is easy to miss the fact that user needs to change to "Squash and merge" again.

Having that, the commit history with "Review 2" and similar commits that were not intended for the master branch will get merged

Recognize full URLs as issue links

Texts like this are recognized as links to the issue:

Fixes #36

but sometimes, due to copy/pasting, this is present in the source description, even when it's rendered as the short link:

Fixes https://github.com/SonarSource/gh-action-lt-backlog/issues/36
Fixes [#36](https://github.com/SonarSource/gh-action-lt-backlog/issues/36)

and we need to support that as well.

See raw version of this:
Fixes #36
Fixes #36
Fixes #36

ToggleLockBranch: Disable Auto-Merge on existing PRs

When a branch is locked/unlocked, the action should:

  • iterate all PRs targeting that branch
  • disable AutoMerge, if it is enabled. For locking AND unlocking.

https://docs.github.com/en/graphql/reference/mutations#disablepullrequestautomerge

For testing: Validate what will happen if the repo doesn't have Auto-Merge enabled.

In case master is frozen (for example due to release), we don't want any PR to accidentally be merged faster than a version bump.

The disabling should happen

  • when locking the branch, to clearly indicate that PRs will not be merged after
  • when unlocking the branch, to prevent unexpected auto-merge for PRs that were configured for auto-merge in the meantime

Create card when external PR is merged

When external contributor PR is merged, create a "Note" card in a Kanban column.
Do not run for bots.

Default text: Release notes: External contribution #xxxx <user>
Configurable prefix: Release notes: External contribution

#xxxx is the PR number
<user> is the user name without @ to avoid tagging users

Find card on project without column

When a card is manually added to the project, but not assigned a column, it currently cannot be found.

Fix it somehow - find the card assignment first.

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.