Allow changing instance url - #236
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a Snap-specific mechanism to override the Jira instance URL at runtime (via snap set), and surfaces guidance for users in both the UI and documentation.
Changes:
- Add a Snap
configurehook to persist ajira-serversnap config value and invalidate cached Jira credentials when the server changes. - Update Snap runtime environment handling so the configured Jira server URL is exported as
JIRA_SERVERfor app commands. - Add user-facing instructions in the Jira auth modal and README on how to change/reset the Jira server URL.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/bugit_v2/bug_report_submitters/jira_submitter.py | Shows Snap-only guidance in the Jira auth modal for changing the configured Jira server. |
| snap/snapcraft.yaml | Documents the override mechanism and ensures the submit app runs with the env wrapper. |
| snap/local/scripts/env_wrapper.sh | Exports JIRA_SERVER from Snap-persisted configuration when present. |
| snap/hooks/configure | Implements snap set bugit jira-server=... handling and invalidates cached credentials on change. |
| README.md | Documents how to set/unset the Jira server URL for the Snap install. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
snap/hooks/configure:27
- The URL sanity-check regex allows values like
https://?orhttps:///pathbecause it doesn't actually require a host portion (despite the comment saying it does). This could lead to storing an unusable Jira server URL and confusing failures at runtime.
# only a lightweight sanity check: must be an http(s) URL with a host
# made up of valid URL characters (no whitespace or other invalid
# chars), not a full validation that it's a real/reachable Jira instance
if ! printf '%s' "$JIRA_SERVER" | grep -Eq '^https?://[A-Za-z0-9._~:/?#@!$&()*+,;=%-]+$'; then
echo "jira-server must be a valid URL with no whitespace or invalid characters, e.g. https://your-instance.atlassian.net (got: '$JIRA_SERVER')" >&2
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.
No description provided.