New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gh deployment
#5541
Comments
May I get the go ahead to explore implementing this inside the CLI? |
You have my explicit permission and endorsement! |
My impression is deployments are considered a legacy feature in maintenance mode, won't receive major updates, no reason for new tooling to support them. Note that the Action docs (though deployment is a supported trigger) don't suggest using them, the examples just lead you to do whatever you need in a job for some other trigger. (Also note linked request was closed with rough API support, first-class command not happening any time soon comment.) |
Could you link to the GitHub Action docs that recommends against using deployments or other discussion that shows that they are being treated as legacy? I didn't get that impression from: https://docs.github.com/en/actions/deployment/about-deployments/deploying-with-github-actions, and the Rest API support seems to be complete: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28 Are you referencing this comment: #5773 (comment)? It looks like GitHub is releasing a beta change to the Deployments UI and there seems to be no clear alternative. We are thinking about using deployments in our CD workflow, so I'm curious if they really are in maintenance-only or not. |
That is the docs page I had in mind @KyleKing - it talks about 'triggering your deployment ' and says 'deployments' many times, but afaict it's not talking about Deployments the feature at any point nor using them, the trigger, or the API in any of the examples. Another thing I saw giving me that impression was #921 (comment) in the first issue requesting this (and closed). I could well be wrong though, I don't have any inside info or anything, it's just my impression. |
Without any direct evidence I'm inclined to disagree that deployments is a legacy feature. The docs page you're referring to is specifically for GitHub actions. I wouldn't expect it to mention the APIs because deployments is already fully integrated. The APIs are meant to be integration points for 1st and 3rd party apps. Such as the github CLI. |
I would like to add that we use the deployment APIs today to communicate deployments to GitHub from our 3rd party deployment tool. Having the ability to do this in the GitHub cli would greatly simplify out scripts. |
I had the same thought about the deployment feature being deprecated. When you rummage around on the possibilities and the different writings, you see that nothing evolves anymore, and that some supports are even removed, like the slack /github deploy command. It would seem that they are working on an overhaul of the feature, at least according to the conclusion of integrations/slack#1150, but I haven't found any recent publications on the subject. I think they have something planned, but it's not a priority. A more clearly defined position would be welcome to inform our choices about implementing certain tools in our teams. |
Our team uses deployments and as far as I know the feature is not deprecated. In fact it looks like a new UI is being worked on https://github.blog/changelog/2023-07-26-github-actions-new-dashboard-view-for-deployments-across-environments-public-beta/. |
I am having a go at this in https://github.com/sjparkinson/gh/tree/add-deployment. Currently creating a deployment works a treat, and I'm now thinking through the UI of a Reading through https://docs.github.com/en/rest/deployments/statuses#create-a-deployment-status, I'd love to hear peoples thoughts on how the flags and arg(s?) could look. Where I'm getting stuck is also around using this in CI and passing a deployment ID around (or not somehow?), thoughts on that welcome too! Naievly what I've done so far is if there's no TTY then the deployment ID is returned by the create command, but that doesn't feel as clear as it could be? # Create a deployment on the current branch
$ gh deployment create
# Create a deployment at a specified ref
$ gh deployment create --ref main
# Create a deployment for a specific environment
$ gh deployment create --environment test # Update the status of a deployment
$ gh deployment edit 12345 --state success
# Update the status of the latest deployment in an
# environment? I don't think this works as you can change
# an environment for a deployment when creating a deployment status...
$ gh deployment edit --environment production --state success
# Update the status of a deployment and include a log URL
$ gh deployment edit 12345 --state in_progress --log-url https://example.com/ |
@sjparkinson that's awesome! I'm not sure "edit" is the best terminology here. Maybe |
I've now got basic commands for Next up is Thoughts on the above welcome! |
@sjparkinson thanks for opening the PR for discussion. Sorry we missed your comment last week, none of the current maintainers have been involved in this thread so we didn't get notifications. We'll make sure to have a look and provide feedback as soon as we can. |
Describe the feature or problem you’d like to solve
This suggestion has already been requested in part here.
However, although an alias would allow this, I think native commands make sense and will be easier to use.
For example, if there is no official github action to create or manipulate a deployment, or in a third party tool, we could use the CLI to manage deployments in a CI.
Proposed solution
How will it benefit CLI and its users?
The commands should allow to:
Additional context
Add any other context like screenshots or mockups are helpful, if applicable.
The text was updated successfully, but these errors were encountered: