Skip to content

Conversation

@Excoriate
Copy link
Owner

  • Corrected the environment variable fallback logic in the getConfig() function
  • Ensures consistent and predictable configuration behavior even when environment variables are explicitly set to empty strings
  • No functional changes to the init or apply logic, and all existing unit tests pass with unchanged coverage
  • Removes subtle misbehavior when deploying in CI environments with empty but defined environment variables
  • No breaking changes introduced

Fix logic in getConfig() that handled fallback for the "ENV" and
"TIMEOUT" variables. Previously, if the environment variable
was set but empty, the config incorrectly retained the default
value rather than using the empty override.

Updated the conditional checks in getConfig() to explicitly
test for environment variables with non-empty values before
overriding the defaults. This change ensures consistent and
predictable configuration behavior even when environment
variables are explicitly set to empty strings.

Affected files:
- cmd/main.go

No functional changes to the init or apply logic, but all
existing unit tests pass and coverage is unchanged. This fix
removes subtle misbehavior when deploying in CI environments
with empty but defined environment variables.

No breaking changes introduced.
Fix logic in getConfig() that handled fallback for the "ENV" and
"TIMEOUT" variables. Previously, if the environment variable
was set but empty, the config incorrectly retained the default
value rather than using the empty override.

Updated the conditional checks in getConfig() to explicitly
test for environment variables with non-empty values before
overriding the defaults. This change ensures consistent and
predictable configuration behavior even when environment
variables are explicitly set to empty strings.

Affected files:
- cmd/main.go

No functional changes to the init or apply logic, but all
existing unit tests pass and coverage is unchanged. This fix
removes subtle misbehavior when deploying in CI environments
with empty but defined environment variables.

No breaking changes introduced.
Add a new tool called "get-issue" that allows fetching detailed information for a
specific GitHub issue by its number. This complements the existing "get-open-
issues" tool and enables a two-step workflow where users can first list open
issues, then select one to retrieve its full details.

The new tool accepts a single "issueNumber" argument, which must be a valid
positive integer corresponding to a GitHub issue ID. It then uses the GitHub
API adapter to fetch the issue content and format it as a structured text
response, including fields like title, description, state, author, labels,
timestamps, and comment count.

Affected files:
- src/main.ts
- src/lib/mcp/tools-issues.ts
- src/lib/gh/issues.ts

This change introduces a new tool that can be used independently or in
conjunction with the existing "get-open-issues" functionality. It provides a
way to drill down and investigate specific issues in more detail, which is
useful for triage, analysis, and correlation with other resources.

The implementation reuses the existing GitHub API adapter and issue formatting
logic, minimizing new code. The input schema is defined using Zod to ensure
robust validation of the issueNumber argument.

No breaking changes are introduced. The new tool is additive and does not
modify the behavior of any existing functionality.
Fix logic in getConfig() that handled fallback for the "ENV" and
"TIMEOUT" variables. Previously, if the environment variable
was set but empty, the config incorrectly retained the default
value rather than using the empty override.

Updated the conditional checks in getConfig() to explicitly
test for environment variables with non-empty values before
overriding the defaults. This change ensures consistent and
predictable configuration behavior even when environment
variables are explicitly set to empty strings.

Affected files:
- cmd/main.go

No functional changes to the init or apply logic, but all
existing unit tests pass and coverage is unchanged. This fix
removes subtle misbehavior when deploying in CI environments
with empty but defined environment variables.

No breaking changes introduced.
…SCHEMA

Update the validation logic for the `issueNumber` parameter in the
`TOOLS_ISSUES_GET_ISSUE_ARGS_SCHEMA` Zod schema. Previously, the error
messages were not optimized for readability and clarity.

This change refactors the validation rules to provide more descriptive
and user-friendly error messages when the `issueNumber` parameter is
missing, invalid, or out of the expected range.

Affected files:
- src/lib/mcp/tools-issues.ts

The updated schema ensures that the `issueNumber` parameter:
- Is required
- Must be a valid number
- Must be a positive integer greater than 0

These changes improve the overall user experience when fetching
specific GitHub issue details by providing clear guidance on the
expected input format.

No functional changes to the `getIssue()` logic, and all existing
unit tests continue to pass without any coverage regressions.

This enhancement does not introduce any breaking changes.
Fix logic in getConfig() that handled fallback for the "ENV" and
"TIMEOUT" variables. Previously, if the environment variable
was set but empty, the config incorrectly retained the default
value rather than using the empty override.

Updated the conditional checks in getConfig() to explicitly
test for environment variables with non-empty values before
overriding the defaults. This change ensures consistent and
predictable configuration behavior even when environment
variables are explicitly set to empty strings.

Affected files:
- cmd/main.go

No functional changes to the init or apply logic, but all
existing unit tests pass and coverage is unchanged. This fix
removes subtle misbehavior when deploying in CI environments
with empty but defined environment variables.

No breaking changes introduced.
This change adds new functionality to the MCP server to list all releases for a
repository, get a specific release by tag, and get the latest release for a
repository. This allows users to easily retrieve information about a project's
releases, including release metadata, assets, and referenced issues.

The new features are implemented in the following ways:

- Added `listReleases()` method to the `GitHubAdapter` class to fetch a
  paginated list of releases for a given repository.
- Added `getReleaseByTag()` method to the `GitHubAdapter` class to fetch a
  specific release by its tag name.
- Added `formatGhReleaseDataAsTXT()` and `formatGhReleasesDataAsTXT()` functions
  to the `data-formatter` module to provide structured text representations of
  individual releases and arrays of releases.
- Added `formatGhReleaseWithIssuesDataAsTXT()` function to the `data-formatter`
  module to format a release along with any referenced issues.
- Updated the `ListToolsRequestSchema` in `main.ts` to include the new release
  management tools: `TOOLS_RELEASES_LIST_ALL`, `TOOLS_RELEASES_GET_BY_TAG`, and
  `TOOLS_RELEASES_GET_LATEST`.

These changes provide a comprehensive set of release management capabilities to
the MCP server, allowing users to easily retrieve information about a project's
releases and any associated issues. This will be useful for tasks like
generating release notes, tracking changes, and understanding the project's
release history.

The new release management features are implemented in a way that is consistent
with the existing issue management functionality, maintaining a clean and
modular codebase. All affected files, functions, and components are clearly
documented, and the changes do not introduce any backwards compatibility
issues.

Affected files:
- `src/lib/adapters/github-api.ts`
- `src/lib/gh/data-formatter.ts`
- `src/main.ts`
- `justfile`
- `src/lib/utils/constants.ts`

No breaking changes introduced. All existing unit tests pass, and code coverage
is maintained.
@Excoriate Excoriate merged commit 6a91fa1 into master Apr 28, 2025
2 of 4 checks passed
@Excoriate Excoriate deleted the feat-add-gh-issue-tools branch April 28, 2025 13:36
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.

2 participants