Skip to content
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

Fixes #38114 - Document path-id param for environment create #11268

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented Dec 18, 2024

What are the changes introduced in this pull request?

Expose path-id as a documented API param for hammer

Considerations taken when implementing this change?

Reusing the param that controller provides. Wording can be changed a bit so opening for reviews.

What are the testing steps for this pull request?

Start server with this PR and test hammer.

Usage:
    hammer lifecycle-environment create [OPTIONS]

Options:
 --description VALUE                            Description of the environment
 --label VALUE                                  Label of the environment
 --name VALUE                                   Name of the environment
 --organization[-id|-title|-label] VALUE/NUMBER Name of organization
 --path-id NUMBER                               If you are adding an environment to an existing path after Library, pass the id
                                                of the environment that is the current successor of Library in the path. It has
                                                to be the id of the old environment following library in this path.
 --prior VALUE                                  Name of the prior environment
 --prior-id NUMBER                              Id of an environment that is prior to the new environment in the chain. It has
                                                to be either the id of Library or the id of an environment at the end of a
                                                chain.
 --registry-name-pattern VALUE                  Pattern for container image names
 --registry-unauthenticated-pull BOOLEAN        Allow unauthenticed pull of container images
 -h, --help                                     Print help

You can now create env in a path at the end of library before the other environments in the path. Pass the env-id of the previous successor of Library in the path.
hammer-cli-katello]$ hammer lifecycle-environment create --label=test12 --name=test12 --prior-id=1 --organization-id=1 --path-id=13

Copy link
Member

@jeremylenz jeremylenz left a comment

Choose a reason for hiding this comment

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

Thanks @sjha4!

Works as expected:

[vagrant@centos9-katello-devel hammer-cli-katello]$ hammer lifecycle-environment list --organization-id 1
---|---------|--------
ID | NAME    | PRIOR  
---|---------|--------
7  | env0_5  | Library
4  | env1    | env0_5 
5  | env2    | env1   
6  | env3    | env2   
1  | Library |        
---|---------|--------
[vagrant@centos9-katello-devel hammer-cli-katello]$ hammer lifecycle-environment create --organization-id 1 --prior Library --path-id 7 --name env0_3
Environment created.
[vagrant@centos9-katello-devel hammer-cli-katello]$ hammer lifecycle-environment list --organization-id 1
---|---------|--------
ID | NAME    | PRIOR  
---|---------|--------
8  | env0_3  | Library
7  | env0_5  | env0_3 
4  | env1    | env0_5 
5  | env2    | env1   
6  | env3    | env2   
1  | Library |        
---|---------|--------

@sjha4
Copy link
Member Author

sjha4 commented Dec 20, 2024

@jeremylenz Does the description of parameter look OK?

 --path-id NUMBER                               If you are adding an environment to an existing path after Library, pass the id
                                                of the environment that is the current successor of Library in the path. It has
                                                to be the id of the old environment following library in this path.

@jeremylenz
Copy link
Member

Does the description of parameter look OK?

Yeah, LGTM 👍

I guess path_id would really be better named successor_id, but I don't think it's worth the hassle of changing that this late in the game.

@sjha4 sjha4 merged commit dbfa2ef into Katello:master Dec 20, 2024
26 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.

2 participants