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

Require env var for custom git fetch #39630

Closed
wants to merge 25 commits into from
Closed

Require env var for custom git fetch #39630

wants to merge 25 commits into from

Conversation

daxmc99
Copy link
Member

@daxmc99 daxmc99 commented Jul 28, 2022

Move customGitFetch configuration from site-admin to a local file.

Test plan

Manual review
Manual testing

@evict
Copy link
Contributor

evict commented Aug 4, 2022

Thanks @andreeleuterio for proposing to move it to a file! Makes things a lot easier.

@evict evict marked this pull request as ready for review August 4, 2022 14:24
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Aug 4, 2022

Codenotify: Notifying subscribers in CODENOTIFY files for diff 91e8afb...b07359b.

Notify File(s)
@indradhanush cmd/gitserver/server/customfetch.go
cmd/gitserver/server/customfetch_test.go
@ryanslade cmd/gitserver/server/customfetch.go
cmd/gitserver/server/customfetch_test.go
@sashaostrikov cmd/gitserver/server/customfetch.go
cmd/gitserver/server/customfetch_test.go
@sourcegraph/delivery doc/admin/how-to/customGitFetch.md
doc/admin/how-to/index.md
doc/admin/monorepo.md

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

Thanks and LGTM other than some world-class formatting issues 😛

cmd/gitserver/server/customfetch.go Outdated Show resolved Hide resolved
cmd/gitserver/server/customfetch.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
cmd/gitserver/server/customfetch_test.go Outdated Show resolved Hide resolved
evict and others added 4 commits August 8, 2022 10:16
Co-authored-by: Joe Chen <joe@sourcegraph.com>
Co-authored-by: Joe Chen <joe@sourcegraph.com>
Co-authored-by: Joe Chen <joe@sourcegraph.com>
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@DaedalusG DaedalusG left a comment

Choose a reason for hiding this comment

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

Assuming the CUSTOM_GIT_FETCH_CONF env var is to be set on the sourcegraph-frontend deployment? Does this env var need to be set on any other deployments?

@unknwon
Copy link
Member

unknwon commented Aug 17, 2022

Assuming the CUSTOM_GIT_FETCH_CONF env var is to be set on the sourcegraph-frontend deployment? Does this env var need to be set on any other deployments?

Should be set on all gitserver not sourcegraph-frontend I think? Defer to @sourcegraph/repo-management

@DaedalusG
Copy link
Contributor

DaedalusG commented Sep 1, 2022

Moved the docs updates from a separate branch to this one 👍, please take one more look at this since I've created a dedicated usage doc @daxmc99 @unknwon

@daxmc99
Copy link
Member Author

daxmc99 commented Sep 1, 2022

@evict @andreeleuterio Is there a reason we moved this to a file?
I actually think this UX is noticeably harder for the critical customer who uses this.
I don't think this can be complete until we provide precise instructions for how to use this in a k8s deployment environment.
I'm happy to do that but I'm not fully understanding what moving from a config option to a file gives us.

It seems simpler to keep the config in the site-config and leverage an infrastructure-level config option to tune it.

Copy link
Contributor

@DaedalusG DaedalusG left a comment

Choose a reason for hiding this comment

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

Holding this till we can provide easy instructions of how to mount the config file

Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

What is the original motivation for this? TBH what we are doing now is just more clunky and lives outside of things like being able to use the migrator/etc for it.

Generally when deprecating something we give a release or two before making it non functional.

cmd/gitserver/server/customfetch_test.go Outdated Show resolved Hide resolved
schema/site.schema.json Outdated Show resolved Hide resolved
Co-authored-by: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
@andreeleuterio
Copy link
Member

@keegancsmith you can find more context here. tl;dr is that this can't be a site-admin setting in the context of Managed Instances.

@@ -303,11 +303,11 @@
}
},
"customGitFetch": {
"description": "JSON array of configuration that maps from Git clone URL domain/path to custom git fetch command.",
"description": "DEPRECATED: THIS VALUE WILL IS IGNORED. CONFIGURATION MOVED TO A LOCAL FILE USE ENVIRONMENT VARIABLE `CUSTOM_GIT_FETCH_CONF` TO SET FILE PATH. JSON array of configuration that maps from Git clone URL domain/path to custom git fetch command.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description": "DEPRECATED: THIS VALUE WILL IS IGNORED. CONFIGURATION MOVED TO A LOCAL FILE USE ENVIRONMENT VARIABLE `CUSTOM_GIT_FETCH_CONF` TO SET FILE PATH. JSON array of configuration that maps from Git clone URL domain/path to custom git fetch command.",
"description": "DEPRECATED: THIS VALUE IS IGNORED. CONFIGURATION MOVED TO A LOCAL FILE USE ENVIRONMENT VARIABLE `CUSTOM_GIT_FETCH_CONF` TO SET FILE PATH. JSON array of configuration that maps from Git clone URL domain/path to custom git fetch command.",

Copy link
Member

Choose a reason for hiding this comment

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

Can't we still read this value if the envvar is not set for 2 releases just so we don't break the customers we know use this? Additionally I'd document that the envvar needs to be set on the gitserver container.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please provide feedback on this new PR #42704

Co-authored-by: Ryan Slade <ryanslade@gmail.com>
@evict
Copy link
Contributor

evict commented Oct 7, 2022

Closing this MR in favour of a simpler solution: #42704. This makes sure the customer can keep using it while others have the option of disabling it.

@evict evict closed this Oct 7, 2022
@evict evict deleted the dax/fix_229 branch October 7, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants