feat(cli): Add --env-gates flag to list-tools for USE_* documentation#59
Merged
feat(cli): Add --env-gates flag to list-tools for USE_* documentation#59
Conversation
- Add FeatureGate interface and gate field to EnhancedToolDefinition - Add gate metadata to all entity registries (labels, wiki, milestones, pipelines, variables, files, mrs, workitems, webhooks, snippets, integrations) - core tools remain ungated (always enabled) - Implement --env-gates flag showing which USE_* controls which tools - Support both markdown table and JSON output formats - Add unit tests for env-gates functionality Usage: yarn list-tools --env-gates # Markdown table yarn list-tools --env-gates --json # JSON output Closes #53
📊 Test Coverage ReportOverall Coverage: 87.5% Coverage Details
Coverage Report: View detailed coverage report
|
There was a problem hiding this comment.
Pull request overview
This PR adds a --env-gates flag to the yarn list-tools CLI command to document which USE_* environment variables control which tools. This replaces manual documentation with automated generation, reducing errors and improving maintainability.
Changes:
- Add
FeatureGateinterface and optionalgatefield to type definitions - Add gate metadata to all 22 gated tools across 11 entity registries
- Implement CLI functions to extract and display gate information in both markdown and JSON formats
- Add comprehensive unit tests for the new functionality
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/types.ts |
Adds FeatureGate interface and gate field to EnhancedToolDefinition |
src/entities/labels/registry.ts |
Adds USE_LABELS gate to browse_labels and manage_label tools |
src/entities/wiki/registry.ts |
Adds USE_GITLAB_WIKI gate to wiki tools |
src/entities/milestones/registry.ts |
Adds USE_MILESTONE gate to milestone tools |
src/entities/pipelines/registry.ts |
Adds USE_PIPELINE gate to pipeline and job tools |
src/entities/variables/registry.ts |
Adds USE_VARIABLES gate to variable tools |
src/entities/mrs/registry.ts |
Adds USE_MRS gate to merge request and discussion tools |
src/entities/files/registry.ts |
Adds USE_FILES gate to file browsing and management tools |
src/entities/workitems/registry.ts |
Adds USE_WORKITEMS gate to work item tools |
src/entities/webhooks/registry.ts |
Adds USE_WEBHOOKS gate to webhook tools |
src/entities/snippets/registry.ts |
Adds USE_SNIPPETS gate to snippet tools |
src/entities/integrations/registry.ts |
Adds USE_INTEGRATIONS gate to integration tools |
src/cli/list-tools.ts |
Implements --env-gates flag with extraction and formatting functions |
tests/unit/cli/list-tools.test.ts |
Adds comprehensive tests for env gates functionality |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
--env-gatesflag toyarn list-toolsthat shows whichUSE_*environment variable controls which toolsChanges
FeatureGateinterface and optionalgatefield toEnhancedToolDefinitiontypeUSE_LABELS:browse_labels,manage_labelUSE_GITLAB_WIKI:browse_wiki,manage_wikiUSE_MILESTONE:browse_milestones,manage_milestoneUSE_PIPELINE:browse_pipelines,manage_pipeline,manage_pipeline_jobUSE_VARIABLES:browse_variables,manage_variableUSE_MRS:browse_merge_requests,browse_mr_discussions,manage_merge_request,manage_mr_discussion,manage_draft_notesUSE_FILES:browse_files,manage_filesUSE_WORKITEMS:browse_work_items,manage_work_itemUSE_WEBHOOKS:list_webhooks,manage_webhookUSE_SNIPPETS:browse_snippets,manage_snippetUSE_INTEGRATIONS:list_integrations,manage_integrationextractEnvGates()andprintEnvGatesMarkdown()functionsUsage
Test plan
yarn list-tools --env-gatesoutputs correct markdown tableyarn list-tools --env-gates --jsonoutputs valid JSONCloses #53