feat: configurable default project/repo for issue-create payloads (#270)#271
Open
fdaviddpt wants to merge 1 commit into
Open
feat: configurable default project/repo for issue-create payloads (#270)#271fdaviddpt wants to merge 1 commit into
fdaviddpt wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
gl-issue-createrequiredprojectin every payload andgh-issue-createrequiredrepo— boilerplate on the most common path, and a runtimemissing required fieldwhen forgotten. This adds a default-resolution layer so the common case is zero-config.Resolution order (most specific wins):
defaults.gitlab_project/defaults.github_repoin.supertool.json(cwd or any parent)origingit remote, host-matched (gitlab/github.com) — the "nice-to-have" auto-detect from the issueChanges
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— fillproject/repofrom the resolver before validation when the payload omits it. Unchanged when present.tests/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,repowould otherwise resolve), plus two new defaulting tests..supertool.example.jsondefaultsblock + comment;docs/presets/{gitlab,github}.mdsections. The repo's own.supertool.jsonnow setsgithub_repo(dogfood).Test plan
originauto-detect against this repo:github.com → Digital-Process-Tools/claude-supertool,gitlab → NoneCloses #270
🤖 Generated by Max