Skip to content

fix(#5465): discover mint URL from org variable for per-org repos#5469

Open
fullsend-ai-coder[bot] wants to merge 3 commits into
mainfrom
agent/5465-init-mint-url-org-var
Open

fix(#5465): discover mint URL from org variable for per-org repos#5469
fullsend-ai-coder[bot] wants to merge 3 commits into
mainfrom
agent/5465-init-mint-url-org-var

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

fullsend repos init fails to discover the mint URL for per-org installations when orgCfg.DispatchSettings().MintURL is empty. This adds a fallback to check the org-level GitHub Actions variable FULLSEND_MINT_URL (set during fullsend admin install).

Related Issue

Fixes #5465

Changes

  • Add org-level variable fallback in discoverRepo() (internal/repos/init.go): after checking orgCfg.DispatchSettings().MintURL, fall back to client.GetOrgVariable(ctx, owner, "FULLSEND_MINT_URL") when the mint URL is still empty
  • Org config remains the primary source; the variable is best-effort
  • GetOrgVariable errors are logged as warnings, not fatal
  • Add three test cases covering: fallback discovery, org config precedence, and error handling

Testing

  • All existing internal/repos tests pass
  • Three new tests added:
    • TestDiscoverRepo_PerOrg_OrgVarFallback — verifies mint URL is discovered from org variable when org config has no mint_url
    • TestDiscoverRepo_PerOrg_OrgConfigTakesPrecedence — verifies org config mint_url wins over org variable
    • TestDiscoverRepo_PerOrg_OrgVarError_NonFatal — verifies GetOrgVariable errors produce a warning, not a failure
  • go vet passes

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO) — human and human-directed agent sessions only
  • I wrote this contribution myself and can explain all changes in it

Closes #5465

Post-script verification

  • Branch is not main/master (agent/5465-init-mint-url-org-var)
  • Secret scan passed (gitleaks — 8b2146e80c0c8d8dc54fa6fa2b4f5957fc48e602..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

discoverRepo only checked orgCfg.DispatchSettings().MintURL for per-org
repos. When the org config had no mint_url in dispatch settings (common
for orgs that rely on the FULLSEND_MINT_URL GitHub Actions variable set
during admin install), the mint URL was left empty and the generated
manifest contained a TODO placeholder.

Add a fallback in discoverRepo that checks the org-level GitHub Actions
variable FULLSEND_MINT_URL via client.GetOrgVariable() when the org
config dispatch settings do not provide a mint URL. The org config
remains the primary source; the variable is a best-effort fallback.
GetOrgVariable errors are logged as warnings and do not fail discovery.

Closes #5465
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 22, 2026 15:39
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Jul 22, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 22, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 3:40 PM UTC · Ended 4:03 PM UTC
Commit: bf2d784 · View workflow run →

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Site preview

Preview: https://b8a8ad58-site.fullsend-ai.workers.dev

Commit: cbee5349a9ca8c734d3c6936f620c14f58cfd855

@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure · Started 3:40 PM UTC · Completed 4:03 PM UTC
Commit: bf2d784 · View workflow run →

@ggallen

ggallen commented Jul 22, 2026

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 22, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:09 PM UTC · Completed 4:23 PM UTC
Commit: 7ada4e0 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [missing-documentation] docs/plans/repos-init.md:169 — The repos init plan documents per-org discovery as "Use mint URL and config from per-org config.yaml" but does not mention the new fallback to the org-level FULLSEND_MINT_URL variable when orgCfg.DispatchSettings().MintURL is empty.
    Remediation: Add a bullet noting the org variable fallback: "If no mint URL is set in config.yaml, fall back to reading the FULLSEND_MINT_URL org-level variable via GetOrgVariable."

Low

  • [error-handling-idiom] internal/repos/init.go:370 — The error handling uses an else if err != nil chain with a compound condition declaring three variables inline, which differs from the separate-declaration pattern used for GetOrgVariable calls elsewhere. The current code is functionally correct — minor style nit.

  • [missing-documentation] docs/cli/repos.md:52 — The repos init Discovery section lists three high-level checks but omits the org-level variable fallback for FULLSEND_MINT_URL. Low priority given the section's abstraction level.


Labels: PR modifies internal/repos/ (repos init command — part of the install workflow)

@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 internal/repos/init.go
@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment component/install CLI install and app setup labels Jul 22, 2026
@ggallen

ggallen commented Jul 22, 2026

Copy link
Copy Markdown
Member

/fs-fix. Rebase and fix all the review issues, both inline and in the sticky comment. Make sure to resolve all the conversations.

@ggallen

ggallen commented Jul 22, 2026

Copy link
Copy Markdown
Member

/fs-fix - Rebase and fix all the review issues, both inline and in the sticky comment. Make sure to resolve all the conversations.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 4:50 PM UTC · Completed 4:56 PM UTC
Commit: 7ada4e0 · View workflow run →

- Refactor GetOrgVariable error handling in discoverRepo to use
  separate declaration and error checks, matching the idiom used
  elsewhere in the codebase (internal/cli/foreign.go, etc.)
- Document org variable fallback in docs/plans/repos-init.md
- Document org variable fallback in docs/cli/repos.md discovery section

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

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed all 3 review findings: refactored error handling idiom to match codebase convention, and added org variable fallback documentation to both the repos init plan and CLI docs.

Fixed (3):

  1. error-handling-idiom: GetOrgVariable compound condition differs from separate-declaration pattern (internal/repos/init.go): Refactored the GetOrgVariable call in discoverRepo to use separate variable declaration and sequential error/exists checks, matching the idiom used in internal/cli/foreign.go and internal/mintcore/github.go
  2. missing-documentation: repos init plan omits org variable fallback (docs/plans/repos-init.md): Added a note to the per-org discovery bullet explaining the FULLSEND_MINT_URL org-level variable fallback when config.yaml has no mint URL
  3. missing-documentation: repos init CLI docs omit org variable fallback (docs/cli/repos.md): Added org variable fallback detail to the per-org config enrollment item in the Discovery section

Tests: passed

Updated by fullsend fix agent

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

Labels

component/install CLI install and app setup ready-for-review Agent PR ready for human review requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repos): init should discover mint URL from org-level variables for per-org repos

2 participants