Add Qodana CLI shell plugin#629
Open
eddumelendez wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new 1Password Shell Plugin for the Qodana CLI to provision authentication material via environment variables when running qodana.
Changes:
- Introduces a new
qodanaplugin with platform metadata and one executable. - Adds an API token credential type provisioned/imported via
QODANA_TOKEN. - Adds unit tests covering token provisioning/import.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| plugins/qodana/plugin.go | Declares the qodana plugin (platform info, credential types, executables). |
| plugins/qodana/qodana.go | Defines the Qodana CLI executable and its NeedsAuth rules. |
| plugins/qodana/project_token.go | Defines the credential type and env-var provisioner/importer mapping. |
| plugins/qodana/project_token_test.go | Adds tests for the credential importer/provisioner behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+11
to
+26
| func TestProjectTokenImporter(t *testing.T) { | ||
| plugintest.TestImporter(t, ProjectToken().Importer, map[string]plugintest.ImportCase{ | ||
| "QODANA_TOKEN environment variable": { | ||
| Environment: map[string]string{ | ||
| "QODANA_TOKEN": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.EXAMPLE", | ||
| }, | ||
| ExpectedCandidates: []sdk.ImportCandidate{ | ||
| { | ||
| Fields: map[sdk.FieldName]string{ | ||
| fieldname.Token: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.EXAMPLE", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }) | ||
| } |
Comment on lines
+15
to
+19
| NeedsAuth: needsauth.IfAll( | ||
| needsauth.NotForHelpOrVersion(), | ||
| needsauth.NotWhenContainsArgs("cloc"), | ||
| needsauth.NotWhenContainsArgs("completion"), | ||
| needsauth.NotWhenContainsArgs("contributors"), |
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.
Overview
Adds a shell plugin for the Qodana CLI, JetBrains' static analysis tool. The plugin provisions the QODANA_TOKEN environment variable so qodana scan and qodana send can authenticate to Qodana Cloud without manually exporting the token.
Type of change
Related Issue(s)
How To Test
Install the Qodana CLI (brew install jetbrains/utils/qodana) and store your project token in 1Password, then run:
Changelog
Authenticate the Qodana CLI using 1Password Shell Plugins to automatically provision
QODANA_TOKENwhen runningqodana scanorqodana send.