Suggested test: copilot/add-labels-target-restriction

Open Beginner friendly
#15,092 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
github
Domain
ci-cd, testing-qa

Research direction

Start by comparing test-copilot-add-labels.md with test-copilot-nosandbox-add-labels.md and test-copilot-siderepo-add-labels.md, then create test-copilot-add-labels-target-restriction.md using the stated workflow_dispatch, copilot, and add-labels setup. Done means the harness confirms a model-selected different item is ignored for a fixed or default triggering target, with no fixtures or secrets required.

Written by the indexing model from the issue text.

Description

suggested new test

Motivation

Link to the gh-aw PR: github/gh-aw#60362 — Enforce add-labels target restrictions

Previously the add_labels handler trusted model-provided item numbers over the configured target, allowing labels to be applied outside the triggering issue/PR. The fix now: defaults omitted targets to triggering; ignores model-provided item numbers for triggering and fixed numeric targets; only accepts model-selected targets when target: "*" is configured.

Proposed test

  • Workflow file: test-copilot-add-labels-target-restriction.md
  • Trigger: workflow_dispatch
  • Engine: copilot
  • Safe output: add-labels
  • Variant: standard

Minimal test prompt sketch

Configure safe-outputs.add-labels with a fixed numeric target (or default triggering) and have the prompt instruct the agent to attempt to emit add_labels for a different, model-chosen item number. Assert the harness confirms the label lands only on the configured/triggering item, not the model-provided one — i.e. the override is ignored.

New fixtures or secrets needed

None.

Notes

Existing tests test-copilot-add-labels.md (issue-triggered) and test-copilot-nosandbox-add-labels.md / test-copilot-siderepo-add-labels.md cover the basic label-add path but not the target-restriction/enforcement behavior. Open suggestions #11353 (add-labels-on-pull-request) and #10716 (add-labels-pull-requests-permission-opt-out) cover different aspects and don't overlap with this scenario.

Generated by 🔍 Suggest New E2E Tests · copilot · auto · 37.1 AIC · ⌖ 6.01 AIC · ⊞ 8.4K ·

Dominant language
Shell
Stars
8
Forks
5
Avg merge
18h 32m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from githubnext/gh-aw-test

All issues in githubnext/gh-aw-test

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.