diff --git a/.github/workflows/workflow-assigned.yml b/.github/workflows/workflow-assigned.yml new file mode 100644 index 000000000..d72190495 --- /dev/null +++ b/.github/workflows/workflow-assigned.yml @@ -0,0 +1,15 @@ +name: Remove workflow labels once an issue is assigned +on: + issues: + types: + - assigned +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - run: gh issue edit "$NUMBER" --remove-label triage --remove-label next + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NUMBER: ${{ github.event.issue.number }} diff --git a/.github/workflows/workflow-roadmap.yml b/.github/workflows/workflow-roadmap.yml new file mode 100644 index 000000000..e3e77f40a --- /dev/null +++ b/.github/workflows/workflow-roadmap.yml @@ -0,0 +1,16 @@ +name: Update roadmap issue #728 +on: + issues: + types: + - assigned + - labeled + workflow_dispatch: +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - run: update-workflow-issue + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/triage.yml b/.github/workflows/workflow-triage.yml similarity index 69% rename from .github/workflows/triage.yml rename to .github/workflows/workflow-triage.yml index d5f99f015..3f6faff3e 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/workflow-triage.yml @@ -4,15 +4,14 @@ on: types: - reopened - opened + - unassigned jobs: label_issues: runs-on: ubuntu-latest permissions: issues: write steps: - - run: gh issue edit "$NUMBER" --add-label "$LABELS" + - run: gh issue edit "$NUMBER" --add-label triage env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} - LABELS: triage diff --git a/.golangci.yml b/.golangci.yml index 20baf806b..897de041f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -101,6 +101,8 @@ linters-settings: desc: "use fmt.Errorf or errors.New" - pkg: braces.dev/errtrace desc: "use fmt.Errorf or errors.New" + - pkg: os/exec + desc: "use github.com/TBD54566975/ftl/backend/common/exec" # wrapcheck: # ignorePackageGlobs: # - github.com/TBD54566975/ftl/* diff --git a/backend/common/exec/exec.go b/backend/common/exec/exec.go index 00a8484cd..e41b0042e 100644 --- a/backend/common/exec/exec.go +++ b/backend/common/exec/exec.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "os" - "os/exec" + "os/exec" //nolint:depguard "syscall" "github.com/kballard/go-shellquote" diff --git a/scripts/update-workflow-issue b/scripts/update-workflow-issue new file mode 100755 index 000000000..a76ed057f --- /dev/null +++ b/scripts/update-workflow-issue @@ -0,0 +1,53 @@ +#!/bin/bash + +list_issues() { + gh issue list "$@" --json number --jq 'map("- #\(.number)")[]' | sort -n +} + +gh issue edit -F - 728 < + +$( + issues="$(list_issues --label urgent)" + test -z "$issues" && exit 0 + + + echo "### Urgent [👀](https://github.com/TBD54566975/ftl/issues?q=is%3Aissue+is%3Aopen+label%3Aurgent)" + echo + echo "> [!WARNING]" + echo "> These issues are urgent and need immediate attention." + echo "$issues" +) + +### Current assigned issues + +$( +gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /orgs/TBD54566975/teams/ftl-team/members | jq -r '.[].login' | grep -v dhanji | sort | while read -r member; do + echo "@$member [👀](https://github.com/TBD54566975/ftl/issues/assigned/$member)" + echo + list_issues -a "$member" + echo +done +) + +$( + issues="$(list_issues --label triage)" + test -z "$issues" && exit 0 + + echo "### Needs triage [👀](https://github.com/TBD54566975/ftl/issues?q=is%3Aissue+is%3Aopen+label%3Atriage)" + echo + echo "$issues" +) + +### Next [👀](https://github.com/TBD54566975/ftl/issues?q=is%3Aissue+is%3Aopen+label%3Anext) + +$( + issues="$(list_issues --label next)" + if test -z "$issues"; then + echo "> [!WARNING]" + echo "> There are no issues labelled for upcoming work." + exit 0 + fi + echo "$issues" +) +EOF \ No newline at end of file