Skip to content

feat: configurable default project/repo for issue-create payloads (#270)#271

Open
fdaviddpt wants to merge 1 commit into
masterfrom
feat/default-project-repo-270
Open

feat: configurable default project/repo for issue-create payloads (#270)#271
fdaviddpt wants to merge 1 commit into
masterfrom
feat/default-project-repo-270

Conversation

@fdaviddpt
Copy link
Copy Markdown
Contributor

Context

gl-issue-create required project in every payload and gh-issue-create required repo — boilerplate on the most common path, and a runtime missing required field when forgotten. This adds a default-resolution layer so the common case is zero-config.

Resolution order (most specific wins):

  1. explicit field in the payload
  2. defaults.gitlab_project / defaults.github_repo in .supertool.json (cwd or any parent)
  3. the origin git remote, host-matched (gitlab / github.com) — the "nice-to-have" auto-detect from the issue

Changes

  • presets/_remote_default.py (new) — shared resolver: config_default (walks up for .supertool.json), parse_remote (scp / ssh:// / https:// forms), origin_slug (host-matched), resolve (config > remote).
  • presets/{gitlab,github}/issue_create.py — fill project/repo from the resolver before validation when the payload omits it. Unchanged when present.
  • Teststests/test_remote_default.py (new, 23 cases: URL parsing, config lookup, origin matching, precedence). tests/test_issue_create.py — the two missing-field tests now disable auto-detect (behavior genuinely changed: with a github origin present, repo would otherwise resolve), plus two new defaulting tests.
  • Docs.supertool.example.json defaults block + comment; docs/presets/{gitlab,github}.md sections. The repo's own .supertool.json now sets github_repo (dogfood).

Test plan

  • Full suite: 3108 passed, 34 skipped, coverage 87.57% (gate 86%)
  • Real origin auto-detect against this repo: github.com → Digital-Process-Tools/claude-supertool, gitlab → None

Closes #270

🤖 Generated by Max

gl-issue-create / gh-issue-create no longer require project/repo in every
payload. Resolution order (most specific wins): explicit payload field >
defaults.{gitlab_project,github_repo} in .supertool.json > the `origin` git
remote, host-matched (gitlab / github.com).

New presets/_remote_default.py shared resolver, wired into both issue_create
scripts before validation. Adds tests, docs, and example config; the repo's
own .supertool.json now sets github_repo (dogfood).

Closes #270

Co-Authored-By: Max <noreply>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable default for project / repo field (e.g. fdavid/dvsi)

1 participant