Skip to content

[WIP] Add Amazon Q Developer plugin support in CLI#150

Open
Claude wants to merge 3 commits into
mainfrom
claude/add-amazon-q-developer-support
Open

[WIP] Add Amazon Q Developer plugin support in CLI#150
Claude wants to merge 3 commits into
mainfrom
claude/add-amazon-q-developer-support

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 28, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Amazon Q Developer plugin support</issue_title>
<issue_description>## Summary

Add Amazon Q Developer as a supported DevOps tool in the CLI. Amazon Q Developer is AWS's AI coding assistant — the primary competitor to GitHub Copilot — providing AI coding metrics (suggestions, chat interactions, code reviews, inline completions).

Upstream Plugin

q_dev in incubator-devlake/backend/plugins/q_dev/

Property Value
Plugin slug q_dev
Auth AWS credentials (AccessKeyId + SecretAccessKey) — completely different from all other plugins
Scope type S3 Slices (time-based data prefixes in S3 buckets)
Scope ID field id
Default endpoint N/A (S3-based, not REST endpoint)
Remote-scope API TBD
Connection test TBD
Extra fields Region, Bucket, IdentityStoreId, IdentityStoreRegion

Why v0.4.x

This is the most complex plugin to integrate due to:

  1. Completely different auth model — requires AWS AccessKeyId + SecretAccessKey pair, not a single token or username/password
  2. S3-based data retrieval — scopes are S3 path prefixes, not REST API resources
  3. Additional identity resolution — IAM Identity Center integration for mapping user UUIDs to names
  4. May need a new auth type on ConnectionDef (e.g., "AwsCredentials") beyond what Generalize auth model for multi-plugin support #85 introduces

Placing this in v0.4.x keeps it on the multi-tool/plugin expansion track instead of the AI-powered operations line. It is still complex, but the work is fundamentally plugin/auth integration rather than an AI command surface.

Dependencies

Blocked by:

Changes

  • Add ConnectionDef for q_dev in connectionRegistry:
    • Custom auth fields for AWS credentials
    • TokenPrompt: "AWS Secret Access Key" (or restructure for two-field auth)
    • EnvVarNames: []string{"AWS_SECRET_ACCESS_KEY"}
    • Additional env vars: AWS_ACCESS_KEY_ID, AWS_REGION
    • ScopeFunc: scopeQDevHandler
  • Implement scopeQDevHandler:
    • S3 path-based scope selection (year/month/account)
    • May need a custom scope struct for S3 slice metadata
  • Potentially extend ConnectionDef auth model for AWS-style credentials
  • Set Available: true

Acceptance Criteria

  • gh devlake configure connection add --plugin q_dev creates an Amazon Q Developer connection with AWS credentials
  • Q Developer appears in interactive plugin picker
  • Q Developer scopes select S3 data paths
  • go build ./..., go test ./..., go vet ./... pass</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@Claude Claude AI assigned Claude and ewega Apr 28, 2026
@Claude Claude AI linked an issue Apr 28, 2026 that may be closed by this pull request
4 tasks
Add support for Amazon Q Developer as a DevOps tool plugin with AWS credential authentication and S3-based scope configuration.

- Add QDevS3Slice type for S3 time-sliced scope entries
- Extend ConnectionParams, ConnectionCreateRequest, and ConnectionTestRequest with AWS-specific fields (AccessKeyID, SecretAccessKey, Region, Bucket, IdentityStoreID, IdentityStoreRegion)
- Add ConnectionDef for q_dev plugin with AwsCredentials auth method
- Implement scopeQDevHandler for interactive S3 scope selection (account-based or prefix-based)
- Add comprehensive tests for q_dev connection and AWS credential handling
- Support both account-based scopes (recommended) and legacy explicit prefix scopes

Agent-Logs-Url: https://github.com/DevExpGbb/gh-devlake/sessions/cce9936b-4e70-4bbc-93b6-c92b8c407c20

Co-authored-by: ewega <26189114+ewega@users.noreply.github.com>
Comment thread cmd/configure_scopes.go Fixed
@Claude Claude AI requested a review from ewega April 28, 2026 20:21
…ariable'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@ewega ewega marked this pull request as ready for review May 22, 2026 13:12
Copilot AI review requested due to automatic review settings May 22, 2026 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial Amazon Q Developer (q_dev) plugin wiring to the gh-devlake GitHub CLI extension by extending connection payload types, registering the plugin in the connection registry, and adding a first-pass scope configuration handler.

Changes:

  • Added QDevS3Slice scope payload type for PUT /scopes.
  • Extended DevLake client connection create/test request payloads with AWS-specific fields.
  • Registered q_dev in connectionRegistry, added tests for the registry entry and AWS-field request building, and introduced an interactive scopeQDevHandler.
Show a summary per file
File Description
internal/devlake/types.go Adds QDevS3Slice struct for Q Developer S3 slice scope upserts.
internal/devlake/client.go Extends connection create/test request payloads with AWS credential + bucket/region fields.
cmd/connection_types.go Adds AWS fields to ConnectionParams, maps them into create/test requests, and registers the q_dev plugin definition.
cmd/connection_types_test.go Adds coverage for the q_dev registry entry and AWS-specific request field mapping.
cmd/configure_scopes.go Adds scopeQDevHandler to create and upsert a Q Developer S3 slice scope.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 6

Comment thread cmd/connection_types.go
Comment on lines 126 to 173
// BuildCreateRequest constructs the API payload for creating this connection.
func (d *ConnectionDef) BuildCreateRequest(name string, params ConnectionParams) *devlake.ConnectionCreateRequest {
endpoint := d.Endpoint
if params.Endpoint != "" {
endpoint = params.Endpoint
}
req := &devlake.ConnectionCreateRequest{
Name: name,
Endpoint: endpoint,
Proxy: params.Proxy,
AuthMethod: d.authMethod(),
RateLimitPerHour: d.rateLimitOrDefault(),
EnableGraphql: d.EnableGraphql,
}
if d.NeedsUsername && params.Username != "" {
// BasicAuth-style plugins (e.g., Jenkins, Bitbucket, Jira) expect credentials
// in username/password fields, not in the token field.
req.Username = params.Username
req.Password = params.Token
} else {
req.Token = params.Token
}
if (d.NeedsOrg || d.NeedsOrgOrEnt) && params.Org != "" {
req.Organization = params.Org
}
if (d.NeedsEnterprise || d.NeedsOrgOrEnt) && params.Enterprise != "" {
req.Enterprise = params.Enterprise
}
// AWS-specific fields (for Amazon Q Developer)
if params.AccessKeyID != "" {
req.AccessKeyID = params.AccessKeyID
}
if params.SecretAccessKey != "" {
req.SecretAccessKey = params.SecretAccessKey
}
if params.Region != "" {
req.Region = params.Region
}
if params.Bucket != "" {
req.Bucket = params.Bucket
}
if params.IdentityStoreID != "" {
req.IdentityStoreID = params.IdentityStoreID
}
if params.IdentityStoreRegion != "" {
req.IdentityStoreRegion = params.IdentityStoreRegion
}
return req
Comment thread cmd/connection_types.go
Comment on lines +463 to +477
ConnectionFlags: []FlagDef{
{Name: "access-key-id", Description: "AWS Access Key ID"},
{Name: "secret-access-key", Description: "AWS Secret Access Key"},
{Name: "region", Description: "AWS region (e.g., us-east-1)"},
{Name: "bucket", Description: "S3 bucket name containing Q Developer data"},
{Name: "identity-store-id", Description: "IAM Identity Center store ID (optional)"},
{Name: "identity-store-region", Description: "IAM Identity Center region (optional)"},
},
ScopeFlags: []FlagDef{
{Name: "account-id", Description: "AWS account ID for scope generation"},
{Name: "year", Description: "Year for data collection (e.g., 2024)"},
{Name: "month", Description: "Month for data collection (1-12, optional)"},
{Name: "base-path", Description: "S3 base path prefix (optional)"},
{Name: "prefix", Description: "Explicit S3 prefix (alternative to account-id)"},
},
Comment thread cmd/connection_types.go
Comment on lines +448 to +460
Plugin: "q_dev",
DisplayName: "Amazon Q Developer",
Available: true,
Endpoint: "", // S3-based, no REST endpoint
SupportsTest: false,
AuthMethod: "AwsCredentials",
RateLimitPerHour: 20000,
RequiredScopes: []string{},
ScopeHint: "",
TokenPrompt: "AWS Secret Access Key",
EnvVarNames: []string{"AWS_SECRET_ACCESS_KEY"},
EnvFileKeys: []string{"AWS_SECRET_ACCESS_KEY"},
ScopeFunc: scopeQDevHandler,
Comment thread cmd/configure_scopes.go
Comment on lines +1636 to +1653
// scopeQDevHandler configures S3-based scopes for Amazon Q Developer.
// Scopes are time-sliced S3 prefixes (year/month) for Q Developer data collection.
func scopeQDevHandler(client *devlake.Client, connID int, org, enterprise string, opts *ScopeOpts) (*devlake.BlueprintConnection, error) {
// Determine scope creation mode
var accountID, prefix, basePath string
var year, month int

fmt.Println("\n📝 Configuring Amazon Q Developer scope...")
fmt.Println(" Scopes represent S3 data slices for Q Developer metrics.")
fmt.Println()

// Prompt for account ID (recommended) or explicit prefix (legacy)
accountID = prompt.ReadLine("AWS Account ID (leave empty for explicit prefix)")
if accountID != "" {
// Account-based scope (new style)
basePath = prompt.ReadLine("S3 base path [leave empty for default]")
yearStr := prompt.ReadLine("Year for data collection (e.g., 2024)")
if yearStr == "" {
Comment on lines +435 to +443
t.Run("AWS fields populated correctly", func(t *testing.T) {
req := def.BuildCreateRequest("test-q-dev", ConnectionParams{
AccessKeyID: "AKIAIOSFODNN7EXAMPLE",
SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
Region: "us-east-1",
Bucket: "my-q-developer-bucket",
IdentityStoreID: "d-1234567890",
IdentityStoreRegion: "us-east-1",
})
Comment thread cmd/configure_scopes.go
Comment on lines +1647 to +1663
// Prompt for account ID (recommended) or explicit prefix (legacy)
accountID = prompt.ReadLine("AWS Account ID (leave empty for explicit prefix)")
if accountID != "" {
// Account-based scope (new style)
basePath = prompt.ReadLine("S3 base path [leave empty for default]")
yearStr := prompt.ReadLine("Year for data collection (e.g., 2024)")
if yearStr == "" {
return nil, fmt.Errorf("year is required")
}
var err error
year, err = strconv.Atoi(yearStr)
if err != nil || year < 2020 || year > 2100 {
return nil, fmt.Errorf("invalid year: %s", yearStr)
}

monthStr := prompt.ReadLine("Month (1-12, leave empty for full year)")
if monthStr != "" {
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.

Amazon Q Developer plugin support

3 participants