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

Add anonymous open environment routes #377

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

seanyeh
Copy link
Contributor

@seanyeh seanyeh commented Sep 5, 2024

Adds methods for the anonymous open env routes so that the Pulumi CLI can use them

@seanyeh seanyeh force-pushed the syeh/add-anonymous-open-env branch from 431352f to 9f1ce7e Compare September 5, 2024 19:54
@seanyeh seanyeh added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Sep 5, 2024
@seanyeh seanyeh marked this pull request as ready for review September 5, 2024 21:34
@seanyeh seanyeh requested a review from a team September 5, 2024 21:34
@@ -677,6 +685,16 @@ func (pc *client) GetOpenEnvironmentWithProject(ctx context.Context, orgName, pr
return &resp, nil
}

func (pc *client) GetAnonymousOpenEnvironment(ctx context.Context, orgName, openSessionID string) (*esc.Environment, error) {
var resp esc.Environment
path := fmt.Sprintf("/api/esc/environments/%v/yaml/open/%v", orgName, openSessionID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this include project in the URL? As far as I understand, envName and project are not used, but eventually we will remove routes without project, right?

Also, nit - ideally should be more specific and use %s for strings, generic is always more bug-prone

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we will remove preview routes but this is a GA route. we decided that we don't need to include projects in this route for anonymous envs.

}

var resp esc.Value
path := fmt.Sprintf("/api/esc/environments/%v/yaml/open/%v", orgName, openSessionID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@seanyeh seanyeh force-pushed the syeh/add-anonymous-open-env branch from 9f1ce7e to 9f2fd43 Compare September 6, 2024 14:58
@seanyeh seanyeh merged commit 9bdb66f into feature/projects Sep 6, 2024
6 checks passed
@seanyeh seanyeh deleted the syeh/add-anonymous-open-env branch September 6, 2024 18:14
seanyeh added a commit that referenced this pull request Sep 10, 2024
seanyeh added a commit that referenced this pull request Sep 10, 2024
seanyeh added a commit that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants