Skip to content

⭐ Add GCP Artifact Registry support with 9 new resource types and ~45 fields#6701

Merged
tas50 merged 9 commits intomainfrom
tas50/gcp_artifact
Mar 11, 2026
Merged

⭐ Add GCP Artifact Registry support with 9 new resource types and ~45 fields#6701
tas50 merged 9 commits intomainfrom
tas50/gcp_artifact

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Feb 27, 2026

Summary

Add GCP Artifact Registry support with 9 new resource types and ~45 fields:

New Resources

  • gcp.project.artifactRegistryService - Top-level service resource with repository listing
  • gcp.project.artifactRegistryService.repository - Registry repositories with full metadata, labels, IAM policy bindings, and sub-resources
  • gcp.project.artifactRegistryService.repository.vulnScanConfig - Vulnerability scanning configuration (enablement state, config, last enable time)
  • gcp.project.artifactRegistryService.repository.cleanupPolicy - Artifact cleanup policies with type discriminator (condition vs. mostRecentVersions)
  • gcp.project.artifactRegistryService.repository.cleanupPolicy.condition - Condition-based cleanup (tag state, prefixes, age filters)
  • gcp.project.artifactRegistryService.repository.cleanupPolicy.mostRecentVersions - Version-count-based cleanup (keep count, package prefixes)
  • gcp.project.artifactRegistryService.repository.formatConfig - Format-specific config (Docker immutable tags, Maven version policy)
  • gcp.project.artifactRegistryService.repository.modeConfig - Mode-specific config (virtual upstream policies, remote repo settings)
  • gcp.project.artifactRegistryService.repository.upstreamPolicy - Virtual repository upstream policy entries

New Fields on repository

projectId, resourcePath, name, location, description, format, mode, labels, kmsKeyName, createTime, updateTime, sizeBytes, registryUri, satisfiesPzs, satisfiesPzi, cleanupPolicyDryRun, vulnerabilityScanningConfig, cleanupPolicies, formatConfig, modeConfig, iamPolicy()

Alias

gcp.artifactregistrygcp.project.artifactRegistryService

> gcp.project.artifactRegistryService.repositories{*}
gcp.project.artifactRegistryService.repositories: [
  0: {
    projectId: "my-project"
    resourcePath: "projects/my-project/locations/us-central1/repositories/my-repo"
    name: "my-repo"
    location: "us-central1"
    description: "Docker images"
    format: "DOCKER"
    mode: "STANDARD_REPOSITORY"
    labels: {}
    kmsKeyName: ""
    sizeBytes: 1048576
    registryUri: "us-central1-docker.pkg.dev/my-project/my-repo"
    satisfiesPzs: false
    satisfiesPzi: false
    cleanupPolicyDryRun: false
    formatConfig: gcp.project.artifactRegistryService.repository.formatConfig id="..."
    modeConfig: gcp.project.artifactRegistryService.repository.modeConfig id="..."
    vulnerabilityScanningConfig: gcp.project.artifactRegistryService.repository.vulnScanConfig id="..."
    cleanupPolicies: []
  }
]

Test plan

  • Build and install GCP provider: make providers/build/gcp && make providers/install/gcp
  • Verify repository listing: mql shell gcp --project <project> then gcp.artifactregistry.repositories
  • Verify sub-resources: gcp.artifactregistry.repositories { formatConfig { * } }
  • Verify IAM: gcp.artifactregistry.repositories { iamPolicy { role members } }
  • Verify cleanup policies: gcp.artifactregistry.repositories { cleanupPolicies { policyType action } }
  • CI passes (spellcheck, lint, generated files)

🤖 Generated with Claude Code

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2026

Test Results

5 276 tests  +15   5 272 ✅ +15   2m 3s ⏱️ -13s
  410 suites ± 0       4 💤 ± 0 
   31 files   ± 0       0 ❌ ± 0 

Results for commit 402e9ed. ± Comparison against base commit 0bbaa5c.

♻️ This comment has been updated with latest results.

@tas50 tas50 force-pushed the tas50/gcp_artifact branch 4 times, most recently from c98619a to 117b59a Compare February 28, 2026 13:37
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Solid implementation following established patterns; two design issues could mislead MQL policy authors.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

One potential nil-pointer panic in the init function; everything else follows established patterns.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

This PR adds GCP Artifact Registry support as a new resource provider. The implementation follows established patterns from other GCP services (alloydb, bigtable, etc.). The code is well-structured with proper sub-resource decomposition, IAM policy support, and unit tests for pure functions. A few issues worth noting: a version inconsistency in the versions file, a potential nil pointer dereference in the repository init function, and the location enumeration approach (iterating all locations before listing repositories) could be slow for projects with many locations but appears intentional given the API limitation noted in comments.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Solid implementation with one correctness issue in the init threshold and a nil-slice edge case in ArrayData calls.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Well-structured implementation that follows established GCP provider patterns; two actionable issues worth fixing before merge.

@github-actions

This comment has been minimized.

@mondoo-code-review mondoo-code-review bot dismissed their stale review February 28, 2026 14:18

Superseded by new review

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

This PR adds GCP Artifact Registry support as a new provider resource. The change is well-structured and follows established patterns in the codebase. The implementation covers repositories, IAM policy bindings, vulnerability scanning config, cleanup policies, format config, and mode config. A few minor issues worth noting: a version inconsistency in the versions file, and a potential nil-pointer dereference in the IAM policy loop. Overall the change is consistent and mechanically sound.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

This PR adds GCP Artifact Registry support as a new MQL resource provider. The implementation follows established patterns from other GCP services (alloydb, bigtable, etc.) and is structurally consistent. The code correctly handles the Artifact Registry API's lack of wildcard location support by enumerating locations first. Sub-resources are properly decomposed. Tests cover the pure functions. A few minor issues noted below.

@tas50 tas50 changed the title ⭐ Add GCP artifact registry ⭐ Add GCP artifact registry resources Feb 28, 2026
@tas50 tas50 changed the title ⭐ Add GCP artifact registry resources ⭐ Add GCP Artifact Registry support with 8 new resource types and ~45 fields Feb 28, 2026
@tas50 tas50 added the pending-testing Waiting on manual testing label Feb 28, 2026
@tas50 tas50 changed the title ⭐ Add GCP Artifact Registry support with 8 new resource types and ~45 fields ⭐ Add GCP Artifact Registry support with 9 new resource types and ~45 fields Feb 28, 2026
@tas50 tas50 force-pushed the tas50/gcp_artifact branch from dc43c0a to 402e9ed Compare March 5, 2026 01:31
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

New AWS resources (Route 53, Lambda, WorkSpaces, etc.), Ubuntu Pro detection, and LEDE platform support added without issues.

@tas50 tas50 removed the pending-testing Waiting on manual testing label Mar 11, 2026
tas50 and others added 3 commits March 11, 2026 10:23
Add new resources for exploring the GCP Artifact Registry

Signed-off-by: Tim Smith <tsmith84@gmail.com>
…onfig

Adds a policyType field ("condition" or "mostRecentVersions") to
cleanupPolicy so MQL users can filter by type before inspecting
type-specific sub-resources. Adds a format field to formatConfig
mirroring the parent repository's format so the sub-resource is
self-describing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract cleanupPolicyType() and extractFormatConfigFields() as testable
pure functions. Add tests covering cleanup policy type discrimination,
format config field extraction for Docker/Maven/NPM, and vuln scan
timestamp handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tas50 and others added 6 commits March 11, 2026 10:23
… check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add KFP to spelling expect list to fix CI spellcheck failure.
- Use role-based IAM binding IDs (repoPath + "/" + role) instead of
  index-based IDs for stability across API call reordering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tas50 tas50 force-pushed the tas50/gcp_artifact branch from 402e9ed to 8deecb8 Compare March 11, 2026 17:24
@tas50 tas50 merged commit 95f5fbc into main Mar 11, 2026
21 checks passed
@tas50 tas50 deleted the tas50/gcp_artifact branch March 11, 2026 17:28
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant