Skip to content

gh-app-provision: single-use callback, exchange failure-path tests, --base-url validation #1919

Open

Description

@gerchowl

Follow-ups from the review of #1918 (gh-app-provision CLI, #1909):

  1. Bug: the callback can run twice. In packages/vig-utils/src/vig_utils/gh_app_provision.py (~L226-253), handle_callback never checks code_done. A browser reload or a second request to /callback runs the exchange again. GitHub codes are single-use, so the replay fails, sets self.error (500), and the terminal can report a failure after the secrets were already written. Nothing leaks. Fix: once a code has been accepted, return early on any later callback, and add a test that replays it.
  2. Untested failure paths. Nothing tests a timed-out (subprocess.TimeoutExpired) or malformed (JSONDecodeError) gh api exchange. Today both fall into the generic handler and print nothing secret. Add tests that pin the error message and that no secret appears in the output.
  3. --base-url isn't validated. It should require an http(s) scheme. Passing --host together with --base-url should be rejected, or the precedence documented. Today --host is silently ignored.

Refs #1909

Activity

  1. added this to the 1.19.0 milestone on Oct 26, 2026
  2. added
    bug
    on Oct 26, 2026
  3. gerchowl commented on Oct 26, 2026

    @gerchowl
    ContributorAuthor

    One more item from the review of #1920 (the docs and skill): step 1 of plugins/devkit/skills/app-provision/SKILL.md runs /devkit:status "so you do not create a second App". But /devkit:status only reports the fixed RELEASE_APP_*/COMMIT_APP_* secrets, so it misses an existing App under any other <PREFIX>. Before provisioning, the skill should check gh secret list | grep <PREFIX>_ (already used in step 6). The skill's frontmatter description also has one over-long line.

  4. added a commit that references this issue on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions