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

Set cloud base url #20

Merged
merged 3 commits into from
Apr 29, 2024
Merged

Set cloud base url #20

merged 3 commits into from
Apr 29, 2024

Conversation

collindutter
Copy link
Member

No description provided.

Comment on lines 96 to 100
"GT_CLOUD_RUN_ID": run.run_id,
"GT_CLOUD_BASE_URL": str(request.base_url),
Copy link
Member Author

Choose a reason for hiding this comment

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

Is the right ordering? Or should they be before os.environ so they can be overridden by os envs?

Copy link
Member

Choose a reason for hiding this comment

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

we want customer to be able to override, so this'd be a gotcha, no?

Copy link
Member

Choose a reason for hiding this comment

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

I'm playing this back in my head, let me know if this is comprehensive and accurate:

  1. In Skatepark emulator, customer wants to override the base URL if they've selected a different URL or port. So having this up here and then overridden by os.environ makes sense.
  2. In Cloud, customer never wants to override the base URL, right? Or are there scenarios where they might?
  3. In all situations, what is the benefit to overriding the Run ID? Should that be explicit?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think rather than try to predict when a user may or may not want to override these environment variables it's better to just have a consistent behavior for overrides.

  1. We provide some system level environment variables (GT_CLOUD_RUN_ID and GT_CLOUD_STRUCTURE_ID).
  2. Then os.environ is layered on.
  3. Then structure.env is layered on.
  4. Then run.env is layered on.

If you want to get fancy and override these, use at your own risk. If they try to set values for resources they don't own, auth will block them anyways.

Copy link
Member

Choose a reason for hiding this comment

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

That works for me. So what's the full set of changes we need to make to enshrine that?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is how it works with the current changes.

Copy link
Member

@SavagePencil SavagePencil left a comment

Choose a reason for hiding this comment

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

the run ID is OK being set here, but I think we want the URL to be overridden by the os.environ, n'est-ce pas?

Copy link
Member

@SavagePencil SavagePencil left a comment

Choose a reason for hiding this comment

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

Checking my logic for when someone would want to override and when it may be useless/harmful. Comment on thread plz.

Comment on lines 96 to 100
"GT_CLOUD_RUN_ID": run.run_id,
"GT_CLOUD_BASE_URL": str(request.base_url),
Copy link
Member

Choose a reason for hiding this comment

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

I'm playing this back in my head, let me know if this is comprehensive and accurate:

  1. In Skatepark emulator, customer wants to override the base URL if they've selected a different URL or port. So having this up here and then overridden by os.environ makes sense.
  2. In Cloud, customer never wants to override the base URL, right? Or are there scenarios where they might?
  3. In all situations, what is the benefit to overriding the Run ID? Should that be explicit?

@collindutter collindutter merged commit dc9d83a into main Apr 29, 2024
2 checks passed
@collindutter collindutter deleted the feature/base-url branch April 29, 2024 16:45
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.

None yet

2 participants