Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Add collection flag for postman ECS agent #234

Merged
merged 6 commits into from
Sep 20, 2023
Merged

Conversation

gmann42
Copy link
Contributor

@gmann42 gmann42 commented Sep 15, 2023

  • Adds collection flag

Copy link
Contributor

@mgritter mgritter left a comment

Choose a reason for hiding this comment

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

This is a good start.

Most of these are cosmetic; I would like us to do a better job signaling failures to look up the collection ID, though.

cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/ecs.go Outdated Show resolved Hide resolved
cmd/internal/ecs/ecs.go Outdated Show resolved Hide resolved
}
return cmderr.AkitaErr{
Err: fmt.Errorf(
"could not find the serviceId for %q",
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't mean anything to the user; try to avoid showing "serviceID". There are three cases to consider:

  1. The collection ID doesn't exist.
  2. The API key presented doesn't have access (or I suppose the API key is absent?)
  3. There was an internal problem creating the new service and they need support.

I don't think we can distinguish between 1 + 2, but we should have a friendly error message specifying that the problem is almost certainly their key. (And if they didn't specify one at all, make clear that that is the problem!)

Copy link
Contributor Author

@gmann42 gmann42 Sep 18, 2023

Choose a reason for hiding this comment

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

Yeah I was thinking of discussing the same, Once I have the end to end things working will fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The correct error states handling is being already done by the function GetOrCreateServiceIDByPostmanCollectionID

cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
cmd/internal/ecs/ecs.go Outdated Show resolved Hide resolved
cmd/internal/ecs/add.go Outdated Show resolved Hide resolved
Comment on lines 858 to 860
{Name: aws.String("POSTMAN_AWS_REGION"), Value: &wf.awsRegion},
{Name: aws.String("POSTMAN_ECS_SERVICE"), Value: &wf.ecsService},
{Name: aws.String("POSTMAN_ECS_TASK"), Value: &wf.ecsTaskDefinitionFamily},
Copy link
Contributor

Choose a reason for hiding this comment

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

If these are modified, then the code that reads them back out should also be modified, ideally in a backwards-compatible way. As we discussed, there is some question about their value because tags aren't visible in the Postman UI at all (although they could be -- for example we might start annotating each collection with information about the sources of data.) So I would be OK leaving these as AKITA_ for now, but if they change they should change both places.

https://github.com/akitasoftware/akita-cli/blob/e4b857e27663a0138107eec34c8d4d1ec41e5f58/deployment/deployment.go#L25-L32

@mgritter
Copy link
Contributor

It looks like "Akita" still appears a bunch of times in prompts or log messages, I assume that is TBD in OBS-365?

@gmann42
Copy link
Contributor Author

gmann42 commented Sep 20, 2023

It looks like "Akita" still appears a bunch of times in prompts or log messages, I assume that is TBD in OBS-365?

Yeah I tried removing it wherever I saw it. Will scan more closely as a part of OBS-365

@gmann42 gmann42 removed the request for review from mudit-postman September 20, 2023 16:37
@mgritter mgritter merged commit b54c18c into main Sep 20, 2023
1 check passed
@mgritter mgritter deleted the feature/OBS-362-ecs-postman branch September 20, 2023 16:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants