Commit graph

33 commits

Author SHA1 Message Date
William Martin
e5f5427b97 Simplify bump-go.sh toolchain logic
Address review feedback: always set both go and toolchain
directives via go mod edit, then let go mod tidy normalize.
This eliminates complex conditional toolchain handling.

Additional fixes:
- Add go mod tidy after edits to reconcile dependencies
- Commit go.sum alongside go.mod
- Filter PR search to open PRs only (--state open)
- Use GITHUB_REPOSITORY for repo instead of hardcoding
- Use git diff to detect no-op bumps post-tidy
- Read go.mod state via go mod edit -json instead of grep

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-13 15:29:49 +02:00
copilot-swe-agent[bot]
d2cc91bdd4 Remove unnecessary null checks in jq output handling
The jq -r flag with // "" operator already returns empty string
for null/missing values, never the literal string "null".
The checks for == "null" are unnecessary.

Co-authored-by: babakks <36728931+babakks@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
355f507c62 Rewrite script to use go mod edit instead of grep/sed
Replace manual parsing and editing with go mod edit:
- Use 'go mod edit -json' to read current go and toolchain directives
- Use 'go mod edit -go' to update go directive
- Use 'go mod edit -toolchain' to update toolchain directive
- Remove manual sed/grep parsing and .bak file handling
- More reliable and maintainable than custom text manipulation

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
209ef1d3b8 Address code review comments
- Clarify comment to say "matches" instead of "matches or exceeds"
- Update PR body to accurately reflect final go.mod state
- Show actual toolchain if present, or note it's not specified
- Provide clear explanation when toolchain is omitted

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
653ffc23ca Improve version comparison to handle both X.Y.0 and X.Y.Z formats
- Compare major.minor versions instead of exact string match
- Preserve go directive if already at latest major.minor
- Handle cases where go.mod has full patch version (e.g., 1.25.6)
- Update PR body to use actual go directive from modified go.mod
- Add detailed comments explaining version handling logic

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
f5610036b9 Update bump-go.sh to handle missing toolchain directive
- Add early trap setup to avoid exit code issues
- Handle missing toolchain directive gracefully with `|| true`
- Add logic to detect when toolchain is expected to be missing
- Add informative messages about missing toolchain
- Implement smart toolchain handling:
  - Skip toolchain when go version matches latest (redundant)
  - Add toolchain when go version is older than latest
  - Update toolchain when it exists but is outdated

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
Kynan Ware
e90343db35 Migrate PR triage workflows to shared workflows
Replace prauto.yml and pr-help-wanted.yml with a single
triage-pull-requests.yml that calls shared reusable workflows from
desktop/gh-cli-and-desktop-shared-workflows:

- triage-label-external-pr: labels external PRs with external,needs-triage
- triage-close-from-default-branch: closes PRs opened from trunk
- triage-pr-requirements: enforces body length + help-wanted issue linkage
- triage-close-no-help-wanted: closes PRs labeled no-help-wanted-issue
- triage-ready-for-review: removes needs-triage on ready-for-review label

Also adds a daily schedule to auto-close PRs with unmet requirements
after 7 days.

Deletes:
- prauto.yml
- pr-help-wanted.yml
- scripts/check-help-wanted.sh

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-17 07:57:52 -07:00
Kynan Ware
a5e97b5b6c Migrate issue triage workflows to shared workflows 2026-02-12 23:32:45 -07:00
Andy Feller
ccc1b4f8c7
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-04 08:30:16 -04:00
Andy Feller
1e69d8a1a0
Update .github/workflows/scripts/spam-detection/process-issue.sh
Co-authored-by: Babak K. Shandiz <babakks@github.com>
2025-08-04 08:30:04 -04:00
Andy Feller
60fdb7ec2b Update spam detection to comment on and close issue
Fixes #11408

These changes enhance the GitHub CLI spam detection logic to automatically comment on and close suspected spam based on the past weeks of usage.

Additionally, there were a few minor enhancements to the script, allowing it to be executed from anywhere rather than the root of the local repository.
2025-08-01 16:50:55 -04:00
Babak K. Shandiz
be67a350b8
ci: use help wanted label link in comment
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-31 15:42:30 +01:00
Babak K. Shandiz
f1996cd571
ci: anchor regexp for help wanted label
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-31 15:42:27 +01:00
Babak K. Shandiz
3d5675f5f7
Improve spam detection evals (#11419)
* ci: improve spam detection evals

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* ci: make test case names consistent

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* ci: remove ill-indented/redundant test case

Signed-off-by: Babak K. Shandiz <babakks@github.com>

---------

Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-31 15:24:08 +01:00
Babak K. Shandiz
6cce077a83
docs(ci): delete obsolete comment
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-28 11:38:50 +01:00
Andy Feller
aa955e1fe6
Update .github/workflows/scripts/spam-detection/generate-sys-prompt.sh 2025-07-21 15:56:11 -04:00
Andy Feller
0c105aff8a Use gh go templating for user prompt
`gh` has Go templating support built in, so let's use it.
2025-07-21 15:51:48 -04:00
Andy Feller
f7448c10e6 Update eval script comments 2025-07-21 15:26:35 -04:00
Andy Feller
03cc1d8311 Remove unnecessary file for heredoc 2025-07-21 15:21:01 -04:00
Andy Feller
8610d8ba8a First pass to optimize and improve 2025-07-21 15:01:22 -04:00
Babak K. Shandiz
8a235ecbef
ci: echo spam detection result
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-16 22:41:26 +01:00
Babak K. Shandiz
1779103a04
ci: correct sed usage to remove Markdown front matter
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-16 21:57:33 +01:00
Babak K. Shandiz
9aae4a525d
docs: fix typo in script docs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-16 21:54:02 +01:00
Babak K. Shandiz
7996a6cdb9
ci: fix potentially confusing typo in system prompt
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-16 21:53:44 +01:00
Babak K. Shandiz
c7c68920d8
ci: add spam issue detection scripts
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-16 21:02:53 +01:00
William Martin
268b11efc9 Ensure go directive is always .0 version
This is because go mod tidy will always add the final minor version so
we might as well handle it in the script ahead of time.
2025-07-09 17:12:11 +02:00
William Martin
00cb1efe83 Ensure go mod tidy is run in bump-go
This is because go mod tidy seems to add minor version to the go mod
directive when it is missing.
2025-07-05 13:17:00 +02:00
William Martin
c58a88a217
Merge pull request #11189 from cli/wm/automate-go-bump
Add workflow to automate go version bumping
2025-07-01 12:21:01 +02:00
William Martin
12aeb1fed2 Add workflow to automate go version bumping 2025-07-01 12:10:22 +02:00
Kynan Ware
45c8c827c5
Add workflow_dispatch support to PR Help Wanted check (#11179)
* Add workflow_dispatch support to PR Help Wanted check

This update allows the PR Help Wanted workflow to be triggered manually via workflow_dispatch with a specified PR URL. It adds logic to fetch PR details using the GitHub CLI for manual runs and unifies variable handling for both event types.

* Update workflow to use PR number instead of URL

Changed the workflow_dispatch input from 'pr_url' to 'pr_number' and updated the script to construct the PR URL from the number.

* Move help-wanted check for draft PRs into script

* Don't prefix URL with `#`

* Invert draft checking logic

Inverting this logic because anything other than "false" means we should skip it.

* Move PR draft status check to shell script

The logic for checking if a pull request is a draft has been moved from the GitHub Actions workflow YAML to the check-help-wanted.sh script. This simplifies the workflow file and centralizes the draft status check within the script.
2025-06-30 12:51:54 -04:00
Kynan Ware
9e161cda4e
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-16 13:20:20 -06:00
Kynan Ware
fa3402f783 Improve help wanted check skipping logic 2025-06-16 13:11:37 -06:00
William Martin
928a326cee
Add workflow to check help wanted labelling (#11105)
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-06-16 17:09:04 +02:00