Skip to content

fix(#600): enforce allow_targets in post-retro.sh - #601

Open
fullsend-ai-coder[bot] wants to merge 3 commits into
mainfrom
agent/600-retro-allow-targets
Open

fix(#600): enforce allow_targets in post-retro.sh#601
fullsend-ai-coder[bot] wants to merge 3 commits into
mainfrom
agent/600-retro-allow-targets

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Add create_issues.allow_targets enforcement to post-retro.sh — the same allowlist check that post-triage.sh applies to prerequisite issues now gates retro-filed proposals. Proposals targeting repos outside the allowlist are skipped with a ::warning:: and surfaced in the summary comment so they can be filed manually.
  • Add 8 tests covering disallowed targets, allowed targets, originating-repo implicit allow, mixed proposals, and no-config fallback behavior.
  • Document the allowlist in docs/retro.md under a new "Issue filing allowlist" subsection.

Approach

Inlined the config-reading logic and is_target_allowed function directly in post-retro.sh, matching the implementation in post-triage.sh (lines 152–189). The originating repo plays the same role as the source repo in triage — always implicitly allowed.

Skipped proposals are tracked in SKIPPED_TARGETS and appended to the summary comment under a "Proposals skipped (target repo not allowed)" heading, with guidance to file manually or update the config.

Testing

  • All 35 post-retro tests pass (27 existing + 8 new)
  • All post-triage tests pass (no regressions)
  • shellcheck clean
  • Secret scan clean

Closes #600

Post-script verification

  • Branch is not main/master (agent/600-retro-allow-targets)
  • Secret scan passed (gitleaks — 317f517da71b710285fff0833becb92105024bdc..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

post-retro.sh created cross-repo issues without checking
create_issues.allow_targets from config.yaml. Add the same
is_target_allowed gate that post-triage.sh uses: read the allowlist
from config, skip disallowed targets with a warning, and surface
skipped proposals in the summary comment so they can be filed manually.

Changes:
- post-retro.sh: add config reading, is_target_allowed function, and
  allowlist check in the proposal filing loop (matching post-triage.sh)
- post-retro-test.sh: add GITHUB_WORKSPACE/config.yaml setup, fixtures
  for disallowed/mixed/originating-repo targets, and 8 new test cases
- docs/retro.md: document that create_issues.allow_targets governs
  retro-filed issues

Note: pre-commit could not run (network error fetching hook repos in
sandbox). The post-script runs an authoritative pre-commit check on
the runner.

Closes #600
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:23 PM UTC · Completed 2:40 PM UTC
Commit: dd0e719 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] scripts/post-retro.sh, scripts/post-retro-test.sh — PR modifies files under the protected scripts/ path. The change is authorized by issue post-retro.sh doesn't respect create_issues.allow_targets #600 and the PR description explains the rationale. Human approval is required for protected-path changes regardless of context.

  • [missing-documentation] docs/triage.md — The new docs/retro.md references "the same allowlist used by the triage agent for prerequisite issues," but docs/triage.md does not document create_issues.allow_targets. This is a pre-existing documentation gap (post-triage.sh has used this config key since it was introduced), not a defect introduced by this PR. Consider adding an "Issue filing allowlist" subsection to docs/triage.md in a follow-up.

Low

  • [coherence] scripts/post-retro.sh:68 — The is_target_allowed function and config-reading logic (~45 lines) are duplicated from scripts/post-triage.sh (lines 150–189). The project has shared libraries in scripts/lib/. Extracting the common logic is out of scope for this PR per AGENTS.md §2–3, but is worth tracking as follow-up to reduce drift risk.

Labels: PR modifies retro agent post-script behavior

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Comment thread scripts/post-retro.sh

echo "Originating: ${ORIGINATING_REPO}#${ORIGINATING_NUMBER}"

# Read the allowlist from config.yaml. The config repo is checked out

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] coherence

The is_target_allowed function and config-reading logic (~45 lines) are duplicated from scripts/post-triage.sh (lines 150-189). The project has shared libraries in scripts/lib/. Extracting the common logic is out of scope per AGENTS.md sections 2-3, but is worth tracking as follow-up.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment retro-agent labels Jul 31, 2026
@ralphbean

Copy link
Copy Markdown
Member

/fs-fix

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 2:45 PM UTC · Completed 2:50 PM UTC
Commit: dd0e719 · View workflow run →

Add "Issue filing allowlist" subsection to docs/triage.md documenting
the create_issues.allow_targets config key that post-triage.sh already
uses for prerequisite issue creation. Closes a documentation gap flagged
in the review of PR #601.

Addresses review feedback on #601
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed 1 of 3 review findings with a code fix (added allowlist documentation to docs/triage.md). Disagreed with 2 findings: one is informational (protected-path requires human approval), one was explicitly marked out of scope by the reviewer (code duplication).

Fixed (1):

  1. missing-documentation: docs/triage.md does not document create_issues.allow_targets (docs/triage.md): Added 'Issue filing allowlist' subsection to docs/triage.md documenting the create_issues.allow_targets config key used by post-triage.sh for prerequisite issue creation. Matches the style of the equivalent section in docs/retro.md.

Disagreed (2):

  1. protected-path: PR modifies files under scripts/: Informational finding — human approval is required for protected-path changes regardless. No code fix needed.
  2. coherence: is_target_allowed duplicated from post-triage.sh: The reviewer explicitly noted this is out of scope for this PR per AGENTS.md §2-3 and suggested tracking as follow-up. No code change needed.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@ralphbean ralphbean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a couple of test tweaks before it merges. See inline comments.

# Allowed target: proposal IS filed (test-org is in the allowlist).
run_test "allow-targets-allowed-filed" \
"${FIXTURE_ONE_PROPOSAL}" \
"gh issue create"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[important] The config fixture sets up allow_targets.repos: [allowed-org/allowed-repo], but none of the new tests target it, so the repo-level branch in is_target_allowed never actually runs. post-triage-test.sh has prerequisites-creates-allowed-issue covering the equivalent path — could we add something similar here?

# Originating repo is always allowed even without explicit allowlist entry.
run_test "allow-targets-originating-repo-allowed" \
"${FIXTURE_ORIGINATING_REPO_TARGET}" \
"gh issue create"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[important] test-org is both the originating repo's org and on the allow list here, so this test passes either way — it can't tell us whether it's the originating-repo check or the org check doing the work. allow-targets-no-workspace-originating-allowed below isolates it correctly since there's no config at all in that case. Could this one target a repo in an org that isn't allow-listed, so it actually proves the originating-repo path?

@ralphbean

Copy link
Copy Markdown
Member

/fs-fix address the review findings

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 5:42 PM UTC · Completed 5:48 PM UTC
Commit: 826eb52 · View workflow run →

…test

Add allow-targets-repo-level-filed test to exercise the repos branch
in is_target_allowed (config sets allowed-org/allowed-repo but no test
targeted it). Update FIXTURE_ORIGINATING_REPO_TARGET to use an org
not in the allowlist (unlisted-org) so allow-targets-originating-repo-allowed
isolates the originating-repo check from the org-allowlist check.

Addresses review feedback on #601
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 2 (human-triggered)

Addressed both review findings. Added a repo-level allowlist test (allow-targets-repo-level-filed) to exercise the repos branch in is_target_allowed. Updated the originating-repo test fixture to use an org not in the allowlist so it isolates the originating-repo check from the org-allowlist check.

Fixed (2):

  1. repo-level allowlist branch untested (scripts/post-retro-test.sh): Added FIXTURE_REPO_ALLOWLIST_TARGET fixture (targets allowed-org/allowed-repo) and allow-targets-repo-level-filed test to exercise the repos branch in is_target_allowed, which was configured in the config fixture but never hit by any test.
  2. originating-repo test does not isolate originating-repo check from org allowlist (scripts/post-retro-test.sh): Updated FIXTURE_ORIGINATING_REPO_TARGET to use unlisted-org/originating-repo (an org NOT in the allowlist) and added ORIGINATING_URL overrides around both originating-repo tests so they isolate the originating-repo check from the org-allowlist check.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

post-retro.sh doesn't respect create_issues.allow_targets

2 participants