Skip to content

Add deployment info to mass pkg get#223

Merged
coryodaniel merged 3 commits intomainfrom
feature/pkg-get-deployment-info
Mar 18, 2026
Merged

Add deployment info to mass pkg get#223
coryodaniel merged 3 commits intomainfrom
feature/pkg-get-deployment-info

Conversation

@coryodaniel
Copy link
Member

Summary

  • Adds latestDeployment, activeDeployment, and deployedVersion fields to the getPackage GraphQL query
  • Introduces PackageDeployment struct with id, status, action, version, createdAt
  • Updates text output template to display deployment details in table format

Test plan

  • make check passes (all tests green, lint issues are pre-existing)
  • Run mass pkg get <slug> against a package with deployments and verify output
  • Run mass pkg get <slug> -o json and verify new fields in JSON output

🤖 Generated with Claude Code

User prompts:
- "update mass pkg get's query to fetch this additional detail. in the mass pkg get standard output just show the latest/active deployment id / status / version / created at."

Changes:
- Add latestDeployment, activeDeployment, deployedVersion to getPackage GraphQL query
- Add PackageDeployment struct and new fields to Package model
- Update package.get.md.tmpl to display deployment info in text output
- Nil-out empty deployments from mapstructure decoding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coryodaniel coryodaniel requested a review from chrisghill as a code owner March 17, 2026 21:00
Copy link
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

This PR extends the package API surface (and CLI output) to include the last deployed bundle version plus “latest” and “active” deployment summaries, by updating the getPackage GraphQL selection set and the corresponding Go types.

Changes:

  • Add deployedVersion, latestDeployment, and activeDeployment to the getPackage GraphQL query and generated Go response types.
  • Extend api.Package with deployment summary fields and post-decode normalization for null nested objects.
  • Update the package get markdown template to display deployed version and deployment details.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/api/zz_generated.go Updates genqlient-generated types/query to include deployed version + deployment summaries and introduces DeploymentAction.
pkg/api/schema.graphql Formatting/cleanup changes in schema definitions (incl. enum value removal).
pkg/api/package.go Adds PackageDeployment and new fields to Package, with decode cleanup for nil nested deployments.
pkg/api/genqlient.graphql Extends getPackage query to request deployed version and deployment summaries.
cmd/templates/package.get.md.tmpl Renders deployed version and latest/active deployment info in CLI output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +63 to +69
// mapstructure creates empty structs for nil nested objects; nil them out
if pkg.LatestDeployment != nil && pkg.LatestDeployment.ID == "" {
pkg.LatestDeployment = nil
}
if pkg.ActiveDeployment != nil && pkg.ActiveDeployment.ID == "" {
pkg.ActiveDeployment = nil
}
coryodaniel and others added 2 commits March 17, 2026 17:27
User prompts:
- "This pr needs to have main pulled and then merged in, it refactored everything into an internal dir ... also, address the PR comments."
- "push the pr and give me the link again"

Changes:
- Make DeployedVersion a *string to handle nullable GraphQL field
- Add nil-out logic in toPackage for empty DeployedVersion pointer
- Fix UTC timestamp formatting in template (call .UTC before .Format)
- Add deref template function for *string rendering
- Add genqlient @pointer directive for deployedVersion field
- Add tests for nil and present deployment decode paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coryodaniel coryodaniel merged commit c61727f into main Mar 18, 2026
5 checks passed
@coryodaniel coryodaniel deleted the feature/pkg-get-deployment-info branch March 18, 2026 06:37
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.

3 participants