Validate when --ticket_id is supplied#162
Conversation
1) Retreive the Secret from the AWS Secret Manager 2) Validate issue_id from jira Signed-off-by: Krishna Harsha Voora <krvoora@redhat.com>
This PR retrieves jira_api from the AWS Secrets Manager uses that token to verify a Jira Issue ID exists, if exists tags hypershift clusters accordingly. Signed-off-by: Krishna Harsha Voora <krvoora@redhat.com>
| type=str, | ||
| help='Specify a desired branch of the corresponding git', | ||
| default='master') | ||
| parser.add_argument( |
There was a problem hiding this comment.
we need that the ticket will be verified during the argument verification. If we wait until _build_cluster, we will have a lot of stuff already created.
please add a type=check_function and check that the ticket is valid during the argparse phase
There was a problem hiding this comment.
Ack, will update the code
| type=str, | ||
| help='Specify a desired branch of the corresponding git', | ||
| default='master') | ||
| parser.add_argument( |
There was a problem hiding this comment.
we need that the ticket will be verified during the argument verification. If we wait until _build_cluster, we will have a lot of stuff already created.
please add a type=check_function and check that the ticket is valid during the argparse phase
| cluster_cmd.append(cluster_name_seed) | ||
| if args.ticket_id: | ||
| jira_apis.verify_issue_id(args.ticket_id) | ||
| cluster_cmd.append("--tags=TicketId:{}.format(args.ticket_id") |
There was a problem hiding this comment.
we need to add here some check, so if ticket id exists, we need to verify the result of verify_issue_id before appending the tag to the cluster_cmd
There was a problem hiding this comment.
we need to add here some check, so if ticket id exists, we need to verify the result of verify_issue_id before appending the tag to the cluster_cmd
We have a check here, in case of invalid Ticket-Id, it will exit.
| '--ticket_id', | ||
| type=str, | ||
| help='Approved Ticket ID for cloud-spend', | ||
| required=False |
There was a problem hiding this comment.
If we are going to add this, required has to be True
There was a problem hiding this comment.
If we are going to add this, the required has to be True
We need this ticket-id if our initial funding is exhausted.
As such, I think this should be False
Signed-off-by: Krishna Harsha Voora <krvoora@redhat.com>
This PR needs #159