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

Fixes to facilitate keeping private + public repos in sync #234

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

djoksimo
Copy link
Contributor

@djoksimo djoksimo commented Mar 16, 2024

  • Changes that should be applied in both this repo and the private fork one.
  • The private repo uses more than just /proxy/ endpoints.

@@ -109,7 +109,7 @@ internal class ForagePinSubmitter(
private fun buildVaultUrl(path: String): HttpUrl =
VAULT_BASE_URL.toHttpUrlOrNull()!!
.newBuilder()
.scheme("https")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

turns out this wasn't necessary after all and impeded local development against http.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@devinmorgan devinmorgan left a comment

Choose a reason for hiding this comment

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

So I think there is a bit of a design question going on here around what URL information should be centralized in EnvConfig vs can live inside of the buildVaultUrl() method.

The proposed change to move proxy/ to .addPathSegment() would make a lot of sense if we anticipate or already use multiple paths for the vault.joinforage.app host. For example:

  • vault.joinforage.app/some_path
  • vault.joinforage.app/another_path

In that world, the "common part" to would be vault.joinforage.app and it would make sense in my mind that specific buildVaultUrl()s would customize the /path portion for their own needs (e.g. adding /some_path or /another_path)

However, if all current and foreseeable usages of vault.joinforage.app are always vault.joinforage.app/path, then I think we're decentralizing information a portion of the "common part", which (albeit slightly) hurts readability (now you need to go to two files to understand that we're hitting vault.joinforage.app/path instead of just one file EnvConfig).

So, my two cents are:

  1. 🆗 deleting of the .scheme("https")
  2. 🚫 let's no include the changes that add .addPathSegment("proxy"), unless we use multiple paths on vault.joinforage.app

@@ -109,7 +109,7 @@ internal class ForagePinSubmitter(
private fun buildVaultUrl(path: String): HttpUrl =
VAULT_BASE_URL.toHttpUrlOrNull()!!
.newBuilder()
.scheme("https")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@djoksimo
Copy link
Contributor Author

So I think there is a bit of a design question going on here around what URL information should be centralized in EnvConfig vs can live inside of the buildVaultUrl() method.

The proposed change to move proxy/ to .addPathSegment() would make a lot of sense if we anticipate or already use multiple paths for the vault.joinforage.app host. For example:

  • vault.joinforage.app/some_path
  • vault.joinforage.app/another_path

In that world, the "common part" to would be vault.joinforage.app and it would make sense in my mind that specific buildVaultUrl()s would customize the /path portion for their own needs (e.g. adding /some_path or /another_path)

However, if all current and foreseeable usages of vault.joinforage.app are always vault.joinforage.app/path, then I think we're decentralizing information a portion of the "common part", which (albeit slightly) hurts readability (now you need to go to two files to understand that we're hitting vault.joinforage.app/path instead of just one file EnvConfig).

So, my two cents are:

  1. 🆗 deleting of the .scheme("https")
  2. 🚫 let's no include the changes that add .addPathSegment("proxy"), unless we use multiple paths on vault.joinforage.app

@devinmorgan We use other paths of vault.joinforage.app (besides /proxy/) in the private repo, which is why I made this PR.

@devinmorgan
Copy link
Contributor

So I think there is a bit of a design question going on here around what URL information should be centralized in EnvConfig vs can live inside of the buildVaultUrl() method.
The proposed change to move proxy/ to .addPathSegment() would make a lot of sense if we anticipate or already use multiple paths for the vault.joinforage.app host. For example:

  • vault.joinforage.app/some_path
  • vault.joinforage.app/another_path

In that world, the "common part" to would be vault.joinforage.app and it would make sense in my mind that specific buildVaultUrl()s would customize the /path portion for their own needs (e.g. adding /some_path or /another_path)
However, if all current and foreseeable usages of vault.joinforage.app are always vault.joinforage.app/path, then I think we're decentralizing information a portion of the "common part", which (albeit slightly) hurts readability (now you need to go to two files to understand that we're hitting vault.joinforage.app/path instead of just one file EnvConfig).
So, my two cents are:

  1. 🆗 deleting of the .scheme("https")
  2. 🚫 let's no include the changes that add .addPathSegment("proxy"), unless we use multiple paths on vault.joinforage.app

@devinmorgan We use other paths of vault.joinforage.app (besides /proxy/) in the private repo, which is why I made this PR.

Can you update the PR description to communicate this? Specifically, I'd love to better understand which paths we use against vault.joinforage.app because this PR seems to only touch /proxy. And, if we do touch other paths besides /proxy/, should edits to that be made in this PR as well? From what I can tell, this PR touches /post. Thanks in advance!

Copy link
Contributor

@devinmorgan devinmorgan left a comment

Choose a reason for hiding this comment

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

Nice!

@djoksimo djoksimo merged commit a24d24d into main Mar 25, 2024
3 of 4 checks passed
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