Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 69 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,44 @@
"gitlabComponentHelper.cacheTime": {
"type": "number",
"default": 3600,
"description": "Cache time for components in seconds"
"description": "How long to keep components cached in seconds. Default is 1 hour.",
"scope": "resource"
},
"gitlabComponentHelper.parser.preferLocalIncludes": {
"type": "boolean",
"default": true,
"markdownDescription": "When enabled, `project:` and `component:` includes will first check your local workspace for the corresponding files and use them if they exist. This is useful for testing a local copy of a PEP or shared configuration. Disable this to strictly fetch them from the remote GitLab server.",
"scope": "resource"
},
"gitlabComponentHelper.parser.activePolicyOverride": {
"type": "string",
"default": "",
"markdownDescription": "The name of a specific Pipeline Execution Policy (PEP) to isolate and parse. If set, only this policy will be parsed and injected. You can select this via the `GitLab CI: Select Active Policy Override` command.",
"scope": "resource"
},
"gitlabComponentHelper.projectPath": {
"type": "string",
"default": "",
"description": "The GitLab project path for the current workspace (e.g., 'my-group/my-project'). Required for resolving project-relative includes in the parser.",
"scope": "resource"
},
"gitlabComponentHelper.parser.pepProjectPathOverride": {
"type": "string",
"default": "",
"markdownDescription": "Explicitly set the path to your Security Policy Project (PEP) to bypass GraphQL auto-discovery. Useful for Instance-level policies (e.g. `compliance-group/policy-repo`).",
"scope": "resource"
},
"gitlabComponentHelper.trustedIncludeRoot": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Additional local directories that are trusted for `local:` includes in the parser. By default, only the current workspace folders are trusted. Use this if your Pipeline Execution Policy (PEP) or other includes reside in a folder outside your primary workspace.",
"scope": "resource"
},
"gitlabComponentHelper.logLevel": {
"type": "string",
Expand Down Expand Up @@ -228,6 +265,31 @@
"command": "gitlab-component-helper.browseComponents",
"title": "GitLab CI: Browse Components"
},
{
"command": "gitlab-component-helper.parsePipeline",
"title": "GitLab CI: Parse Pipeline (Text Output)",
"icon": "$(list-flat)"
},
{
"command": "gitlab-component-helper.selectPolicyOverride",
"title": "GitLab CI: Select Active Policy Override",
"category": "GitLab CI"
},
{
"command": "gitlab-component-helper.setProjectPath",
"title": "GitLab CI: Set Active Project Path",
"category": "GitLab CI"
},
{
"command": "gitlab-component-helper.selectLocalPepOverride",
"title": "GitLab CI: Select Local PEP File Override",
"category": "GitLab CI"
},
{
"command": "gitlab-component-helper.clearPepOverrides",
"title": "GitLab CI: Clear PEP Overrides",
"category": "GitLab CI"
},
{
"command": "gitlab-component-helper.refreshComponents",
"title": "GitLab CI: Refresh Components Cache"
Expand Down Expand Up @@ -264,9 +326,14 @@
"menus": {
"editor/context": [
{
"when": "gitlabComponentHelper.isCiFile",
"when": "resourceFilename =~ /gitlab-ci\\.ya?ml$/",
"command": "gitlab-component-helper.browseComponents",
"group": "navigation"
},
{
"when": "resourceFilename =~ /gitlab-ci\\.ya?ml$/",
"command": "gitlab-component-helper.parsePipeline",
"group": "navigation@2"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ValidationProvider } from './providers/validationProvider';
import type { CachedComponent } from './types/cache';
import type { GitLabYamlFragment } from './types/gitlab-catalog';
import type { HoverContext } from './providers/hoverContentBuilder';
import { registerPipelineParserCommands } from './providers/pipelineParserCommandRegistrations';

/** Component payload passed to the `detachHover` command. Adds the hover-builder's location context. */
type DetachableComponent = Component & { _hoverContext?: HoverContext };
Expand Down Expand Up @@ -163,6 +164,9 @@ export function activate(context: vscode.ExtensionContext) {
})
);

// Register Pipeline Parser commands (TUI output)
registerPipelineParserCommands(context);

// Register command to refresh component cache
logger.debug('[Extension] Registering refreshComponents command...', 'Extension');
context.subscriptions.push(
Expand Down
Loading