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

chore!: remove duplicate Server env vars, plus --basehref -> --base-href #12653

Merged
merged 7 commits into from
Jun 9, 2024

Conversation

agilgur5
Copy link
Member

@agilgur5 agilgur5 commented Feb 11, 2024

Follow-up to #12652 and #6923 (comment) on findings of duplicate env vars

Motivation

Modifications

  • remove the two env vars in a breaking change, and refer users to their ARGO_* equivalents in the upgrade notes
  • replace --basehref with --base-href as a breaking change and mention it in the upgrade notes
  • modify the docs and descriptions that referred to the two env vars
    • plus some small grammar and consistency fixes therein

Verification

Docs build & lint pass.

Notes to Reviewers

Can skip docs/cli/* as it's all auto-generated from the CLI changes

@agilgur5 agilgur5 added area/docs Incorrect, missing, or mistakes in docs area/server labels Feb 11, 2024
- every CLI flag has had an equivalent env var since 96c5626
- `ALLOWED_LINK_PROTOCOL` and `BASE_HREF` each had a duplicate env var as the odd ones out
  - so remove them in a breaking change, and refer users to their `ARGO_*` equivalents in the upgrade notes

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
@agilgur5 agilgur5 force-pushed the chore-server-remove-dupe-envs branch from b0c047a to 8571e1f Compare February 11, 2024 21:37
@agilgur5 agilgur5 marked this pull request as ready for review February 11, 2024 21:39
Copy link
Member

@tczhao tczhao left a comment

Choose a reason for hiding this comment

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

cmd/argo/commands/server.go Show resolved Hide resolved
@agilgur5
Copy link
Member Author

agilgur5 commented Feb 13, 2024

I think we also need to change https://github.com/argoproj/argo-workflows/blob/main/cmd/argo/commands/root.go#L87C102-L87C111 to ARGO_BASE_HREF

See my in-line comment, I gave context on this in the PR description. EDIT: per below, I misread, this is a separate Long description/comment of the CLI, my bad!

@tczhao
Copy link
Member

tczhao commented Feb 14, 2024

Thanks for the links. They make a lot of sense!
I still think we need to change https://github.com/argoproj/argo-workflows/blob/main/cmd/argo/commands/root.go#L87C102-L87C111
from
If your server is behind an ingress with a path (you'll be running "argo server --basehref /...) or "BASE_HREF=/... argo server"):
to
If your server is behind an ingress with a path (you'll be running "argo server --basehref /...) or "ARGO_BASE_HREF=/... argo server"):
or in any style that make sense, the BASE_HREF=/... argo server seems wrong since the env var now has a ARGO_ preifx

@agilgur5
Copy link
Member Author

agilgur5 commented Feb 14, 2024

Ohhh, good catch! I totally missed that in the root.go, especially since it says ARGO_BASE_HREF on the very next line. Sorry I misread your first comment! Thanks for clarifying and quoting it directly, that made it more obvious 🙂

Yea let me modify that too. I could've sworn I searched for all references to BASE_HREF so let me double check that too if I missed this one

@agilgur5
Copy link
Member Author

agilgur5 commented Feb 14, 2024

https://github.com/argoproj/argo-workflows/blob/main/cmd/argo/commands/root.go#L87C102-L87C111

Ah I totally missed this column number in the link -- I was on mobile where it's far off screen to the right so I didn't see the column highlight on first glance

(Screenshot for reference: )

Screenshot_2024-02-14-01-17-15-81_40deb401b9ffe8e1df2f1cc5ba480b12

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
@agilgur5
Copy link
Member Author

https://github.com/argoproj/argo-workflows/blob/main/cmd/argo/commands/root.go#L87C102-L87C111

Yea let me modify that too. I could've sworn I searched for all references to BASE_HREF so let me double check that too if I missed this one

Fixed this one plus a few others. That should be all of them now

@@ -45,7 +45,7 @@ func AddAPIClientFlagsToCmd(cmd *cobra.Command) {
cmd.PersistentFlags().StringVar(&instanceID, "instanceid", os.Getenv("ARGO_INSTANCEID"), "submit with a specific controller's instance id label. Default to the ARGO_INSTANCEID environment variable.")
// "-s" like kubectl
cmd.PersistentFlags().StringVarP(&ArgoServerOpts.URL, "argo-server", "s", os.Getenv("ARGO_SERVER"), "API server `host:port`. e.g. localhost:2746. Defaults to the ARGO_SERVER environment variable.")
cmd.PersistentFlags().StringVar(&ArgoServerOpts.Path, "argo-base-href", os.Getenv("ARGO_BASE_HREF"), "Path to use with HTTP client due to BASE_HREF. Defaults to the ARGO_BASE_HREF environment variable.")
cmd.PersistentFlags().StringVar(&ArgoServerOpts.Path, "argo-base-href", os.Getenv("ARGO_BASE_HREF"), "Path to use with HTTP client due to Base HREF. Defaults to the ARGO_BASE_HREF environment variable.")
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 referring to the "Base HREF" feature now and not the specific env var

@agilgur5 agilgur5 requested a review from tczhao February 14, 2024 18:27
@tczhao
Copy link
Member

tczhao commented Feb 14, 2024

https://github.com/argoproj/argo-workflows/blob/main/cmd/argo/commands/root.go#L87C102-L87C111

Ah I totally missed this column number in the link -- I was on mobile where it's far off screen to the right so I didn't see the column highlight on first glance

(Screenshot for reference: )

No worries. It happens

Copy link
Member

@tczhao tczhao left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
@agilgur5 agilgur5 changed the title chore!: remove duplicated Server env vars chore!: remove duplicate Server env vars, plus --basehref -> --base-href Feb 19, 2024
Copy link
Member

@sarabala1979 sarabala1979 left a comment

Choose a reason for hiding this comment

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

LGTM
Before approve, @terrytangyuan @juliev0 can you take a quick look because of it is breaking change?

@rijos
Copy link

rijos commented Feb 28, 2024

@agilgur5
Copy link
Member Author

Yes, all downstream consumers that use this, like the Helm Charts, will need to be updated. That is the nature of breaking changes.

@agilgur5 agilgur5 added this to the v3.6.0 milestone Apr 12, 2024
@agilgur5
Copy link
Member Author

agilgur5 commented May 22, 2024

Merged main for new PR checks per #13027

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
@agilgur5
Copy link
Member Author

agilgur5 commented Jun 9, 2024

Going to merge this as Tianchu approved and Bala LGTM'd and there have been no reviews from others in the past ~4 months

@agilgur5
Copy link
Member Author

agilgur5 commented Jun 9, 2024

@agilgur5, seems this change will break the helm chart, it still refers to BASE_HREF. See: https://github.com/argoproj/argo-helm/blob/2f82fb5992fe1e390d1ebdbc4be6d5d6c6549a37/charts/argo-workflows/templates/server/server-deployment.yaml#L98

Since ARGO_BASE_HREF already exists, I addressed this in the chart for forward compat: argoproj/argo-helm#2756

@agilgur5 agilgur5 merged commit b560ad3 into argoproj:main Jun 9, 2024
29 checks passed
@agilgur5 agilgur5 deleted the chore-server-remove-dupe-envs branch June 9, 2024 18:57
@agilgur5
Copy link
Member Author

Since ARGO_BASE_HREF already exists, I addressed this in the chart for forward compat: argoproj/argo-helm#2756

Annnd I didn't re-read my own release notes or this PR (it's 4 months old, so quite a time delay) and caused a regression downstream in Argo Helm. Reverted that change in argoproj/argo-helm#2770
Sorry I screwed that up, I meant to be proactive there, but the time delay meant I forgot how my own change worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Incorrect, missing, or mistakes in docs area/server type/tech-debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants