Skip to content

fix: fix deploy to same namespace if organization_id incorrectly set #55

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

Merged
merged 3 commits into from
Mar 15, 2023

Conversation

cyclimse
Copy link
Contributor

@cyclimse cyclimse commented Mar 9, 2023

Summary

What's changed?

We now completely ignore the default_organization_id parameter.

Why do we need this?

We load the config from both env vars, CLI parameters, and config file. By default, most clients will have a default_organization_id in their config file. However, if they use credentials for another account that has no rights in the organization, it can cause various deployment issues.

Why remove it completely? It's not used by the framework.

How have you tested it?

Deployed some examples with the changes.

Checklist

  • I have reviewed this myself
  • There is a unit test covering every change in this PR
  • I have updated the relevant documentation

Details

The cleaner fix would probably have been to not send organization_id when it's unused for filtering, ie disable it only when it causes problems. However, the SDK will always send the client org id if it's explicitly set to a falsy value (check is done with or). To make that work, we would have to remove it from the client config, save it to a local and reapply later which seems cumbersome.

@cyclimse cyclimse self-assigned this Mar 9, 2023
@cyclimse cyclimse force-pushed the fix/cant-deploy-same-namespace branch from 76bf86b to 2cc0fb6 Compare March 9, 2023 15:04
@cyclimse cyclimse requested review from Shillaker and removed request for Shillaker March 9, 2023 15:11
@cyclimse cyclimse marked this pull request as draft March 9, 2023 15:22
Comment on lines -30 to -33
class ServerlessTestProject:
"""
ServerlessTestProject encapsulates the logic of
setting up a clean integration test environment.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry for changing this again but I'm way happier with this new design. Last time I kinda gave up and decided to put everything in a single file and hide away this code as much as possible.

Now, I have separated the create project fixture from the CLI wrappers. To me, it seems a lot cleaner and makes it easier to manage.

@cyclimse cyclimse marked this pull request as ready for review March 14, 2023 08:48
@cyclimse cyclimse force-pushed the fix/cant-deploy-same-namespace branch from 6988495 to 195bcab Compare March 14, 2023 08:51
@cyclimse cyclimse requested a review from Shillaker March 14, 2023 08:52
Copy link
Collaborator

@Shillaker Shillaker left a comment

Choose a reason for hiding this comment

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

Nice, LGTM 👍

@cyclimse cyclimse merged commit 3f3679e into main Mar 15, 2023
@cyclimse cyclimse deleted the fix/cant-deploy-same-namespace branch March 15, 2023 13:28
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