Skip to content

feat: Add ability to get latest prod deployment#289

Merged
JGiola merged 5 commits intomia-platform:mainfrom
fztgreen-veteransunited:feature/add-deployments-command
Feb 2, 2026
Merged

feat: Add ability to get latest prod deployment#289
JGiola merged 5 commits intomia-platform:mainfrom
fztgreen-veteransunited:feature/add-deployments-command

Conversation

@fztgreen-veteransunited
Copy link
Contributor

@fztgreen-veteransunited fztgreen-veteransunited commented Jan 13, 2026

What this PR is for

This PR adds support for retrieving the latest successful deployment for a project environment.


Get Latest Deployment

Usage:

miactl deploy latest [flags]

Flags:

    --environment string   the environment scope for the command
-h, --help                 help for latest
    --project-id string    the ID of the project

Description:

This command fetches the most recent successful deployment for a specified project and environment. It returns deployment details including:

  • Deployment ID
  • Git reference (branch/tag)
  • Pipeline ID
  • Deployment status
  • Completion timestamp
  • Environment information

Example:

miactl deploy latest --project-id my-project --environment production

Output:

Latest deployment for environment production:
ID: deploy-123
Ref: main
Status: success
Finished At: 2026-01-13 14:30:00 +0000 UTC

Technical Changes:

  • Added new latest subcommand under deploy
  • Created DeploymentHistory and EnvironmentInfo resource types
  • Added support for querying deployment history API endpoint
  • Includes comprehensive unit tests

@fztgreen-veteransunited fztgreen-veteransunited changed the title draft: feat: Add ability to get latest prod deployment feat: Add ability to get latest prod deployment Jan 13, 2026
@fztgreen-veteransunited fztgreen-veteransunited marked this pull request as ready for review January 13, 2026 20:27
@fztgreen-veteransunited fztgreen-veteransunited requested a review from a team as a code owner January 13, 2026 20:27
@ThisIsDemetrio
Copy link
Contributor

Hi @fztgreen-veteransunited . That's a great addition, thanks for the time you dedicated.

However, I'd suggest to include this new command under ['miactl deploycommand](https://github.com/mia-platform/miactl/blob/main/internal/cmd/deploy/deploy.go), which groups commands dedicated to deployments, instead ofmiactl runtime` which is dedicated to the resources active in the cluster.

You might have missed that as deploy is not in the miactl --help menu, because it use to be a command and not a group of commands. We are working on it to remove the depreaction before the next miactl release.

Thanks again. We will approve this PR once this update is performed.

@ThisIsDemetrio
Copy link
Contributor

Another request, is to update the CHANGELOG.md file, under the ### Added section on top.

Copy link
Contributor

@ThisIsDemetrio ThisIsDemetrio left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this feature. Before the approval, we prefer to discuss and solve the comments above.

@fztgreen-veteransunited fztgreen-veteransunited force-pushed the feature/add-deployments-command branch from 709e587 to ea95776 Compare January 21, 2026 17:04
@fztgreen-veteransunited
Copy link
Contributor Author

@ThisIsDemetrio I made the requested changes. Please let me know if there are any other concerns. Thank you!

Copy link
Contributor

@ThisIsDemetrio ThisIsDemetrio left a comment

Choose a reason for hiding this comment

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

Thanks for sending this pull request. It looks fine, so it is going to be merged soon.

@JGiola JGiola merged commit 5fd0016 into mia-platform:main Feb 2, 2026
9 checks passed
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