Skip to content

Support Jira Server/DC and split Confluence config (#5) - #6

Open
ucchishta-dd wants to merge 3 commits into
ainoya:mainfrom
ucchishta-dd:fix/server-dc-and-confluence-config
Open

Support Jira Server/DC and split Confluence config (#5)#6
ucchishta-dd wants to merge 3 commits into
ainoya:mainfrom
ucchishta-dd:fix/server-dc-and-confluence-config

Conversation

@ucchishta-dd

Copy link
Copy Markdown

Closes #5.

Summary

This PR fixes several assumptions that break Jira Server/Data Center and split-host Confluence deployments.

Changes

  • add ATLASSIAN_JIRA_API_VERSION to support 2, 3, or latest
  • use configurable Jira REST API paths instead of hardcoded Cloud v3 paths
  • add CONFLUENCE_URL with fallback to ATLASSIAN_URL
  • add CONFLUENCE_USERNAME and CONFLUENCE_API_TOKEN with fallback to shared Atlassian credentials
  • fix Confluence page/search URL rendering to use the configured host and base path
  • make Jira issue formatting handle both string and ADF descriptions
  • update README and .envrc.example

Verification

  • zig build test
  • zig build
  • verified live against:
    • Jira Server/DC issue lookup
    • Confluence search with separate host and credentials

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the tool's compatibility and flexibility by addressing limitations with Jira Server/Data Center and split-host Confluence deployments. It introduces granular control over API versions and separate authentication/URL configurations for Confluence, ensuring the tool can operate effectively across a wider range of Atlassian environments. Additionally, it refines how Jira issue descriptions are rendered, providing a more robust user experience.

Highlights

  • Jira Server/Data Center Support: Introduced configurable Jira REST API versions (2, 3, or latest) to support both Jira Cloud and Jira Server/Data Center deployments, moving away from hardcoded Cloud v3 paths.
  • Split Confluence Configuration: Enabled separate configuration for Confluence instances, allowing distinct URLs, usernames, and API tokens (CONFLUENCE_URL, CONFLUENCE_USERNAME, CONFLUENCE_API_TOKEN) with fallbacks to shared Atlassian credentials.
  • Enhanced Jira Description Formatting: Improved Jira issue formatting to correctly handle and render descriptions provided in both plain string and Atlassian Document Format (ADF).
  • Dynamic Confluence URL Rendering: Updated Confluence page and search result URL rendering to dynamically use the configured host and base path, ensuring correct links for various Confluence setups.
  • Improved HTTP Error Handling: Expanded HTTP status handling in the Atlassian client to include more success statuses and provide clearer error messages for authentication, permission, and not-found issues.
Changelog
  • .envrc.example
    • Added ATLASSIAN_JIRA_API_VERSION for optional Jira API version override.
    • Added CONFLUENCE_URL, CONFLUENCE_USERNAME, and CONFLUENCE_API_TOKEN for separate Confluence configuration.
  • README.md
    • Updated environment variable examples to include ATLASSIAN_JIRA_API_VERSION, CONFLUENCE_URL, CONFLUENCE_USERNAME, and CONFLUENCE_API_TOKEN.
    • Added explanations for the new Confluence and Jira API version environment variables, including fallback logic.
  • src/atlassian_client.zig
    • Added jira_api_version field to AtlassianClient struct and its initialization.
    • Introduced printStatus helper function for consistent HTTP error logging.
    • Expanded HTTP status handling to include .created, .accepted, and .no_content as success statuses, and improved error messages for .unauthorized, .forbidden, and .not_found.
  • src/formatter.zig
    • Added confluenceUrlPrefix function to handle Confluence base path formatting.
    • Implemented appendJiraDocText and renderJiraDescription functions to parse and render Jira Atlassian Document Format (ADF) descriptions into readable text.
    • Modified formatConfluenceSearchResults and formatConfluencePage to accept base_url and base_path parameters, using them to construct correct Confluence URLs.
    • Added a test case for formatJiraIssue to verify ADF description handling.
  • src/jira_client.zig
    • Introduced apiVersion, writeApiPath, and writeSearchEndpoint helper functions to dynamically construct Jira API endpoints based on the configured API version and cloud status.
    • Updated getIssue, searchIssues, getProjects, getTransitions, getComments, and getCurrentUser methods to use the new API path construction helpers, replacing hardcoded API versions.
    • Added new test cases to verify Jira client's API version selection and path generation.
  • src/main.zig
    • Updated printHelp output to reflect new environment variables for Jira API version and separate Confluence credentials.
    • Refactored environment variable parsing to support CONFLUENCE_URL, CONFLUENCE_USERNAME, CONFLUENCE_API_TOKEN, and ATLASSIAN_JIRA_API_VERSION, including fallback logic.
    • Modified client initialization to pass the jira_api_version to AtlassianClient.init.
    • Adjusted handleConfluenceCommand calls to pass the correct confluence_url and confluence_base_path to formatter functions.
    • Separated client initialization for Jira and Confluence commands to allow distinct configurations.
Activity
  • No specific activity (comments, reviews, progress updates) was provided in the context for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request significantly enhances the tool by adding support for Jira Server/DC and introducing separate, flexible configurations for Confluence. The implementation is robust, featuring configurable API versions, fallback credential handling, and support for Jira's Atlassian Document Format (ADF). The inclusion of new tests to validate these changes is also a great practice. My review includes a few suggestions to refactor duplicated logic in the configuration handling within src/main.zig, which will improve code clarity and maintainability.

Comment thread src/main.zig Outdated
Comment thread src/main.zig Outdated
Comment thread src/main.zig Outdated
@ucchishta-dd

Copy link
Copy Markdown
Author

@ainoya thank you for building this tool. I find it the most simple to configure and fits my use case (Jira and Confluence DC) in my org. appreciate if you can take a look at this PR and give some feedback when you can. I'm planning to introduce your tool to my org and recommend they use it with their AI agents.

@ucchishta-dd

ucchishta-dd commented Apr 10, 2026

Copy link
Copy Markdown
Author

@ainoya could you please take a look at this PR and consider merging if all is good? I'm planning to do a knowledge sharing with my team next week and was hoping to get this PR in so I can recommend to my team try your cli out 🙏🏽

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.

Support Jira Server/DC and split-host Confluence deployments

1 participant