Skip to content

Fix repo url parsing #2442

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 1 commit into from
Oct 15, 2024
Merged

Fix repo url parsing #2442

merged 1 commit into from
Oct 15, 2024

Conversation

pkukielka
Copy link
Contributor

@pkukielka pkukielka commented Oct 14, 2024

Fixes https://linear.app/sourcegraph/issue/CODY-3132

Changes

  1. extensionConfiguration_didChange is not called anymore on every opening of the file. It was used to set cody.codebase settings key on the Cody side. But it should not be needed, as it should always be obtained from the currently opened file anyway.

Test plan

  1. Create git test project
  2. Edit .git/config file and change [remote "origin"] to contain url like:
    url = git@github.com:122345/a/b/c/my-Repo.git
  3. Run IntelliJ and switch files few times - there should be no errors (in fact that code path is not executed anymore)
  4. Click right mouse button, Sourcegraph > Open Selection In Sourcegraph Web
  5. It should fail, but URL should start with https://sourcegraph.com/github.com/1234/sourcegraph/a/b/my-Repo/@main/-/blob/

@mkondratek
Copy link
Contributor

To be precise, the url starts with:

https://sourcegraph.com/github.com/122345/a/b/c/my-repo@main/-/blob/

(I assume there are just typos in the test plan).

@@ -81,7 +80,6 @@ object ConfigUtil {
UserLevelConfig.getAutocompleteProviderType()?.vscodeSettingString(),
debug = isCodyDebugEnabled(),
verboseDebug = isCodyVerboseDebugEnabled(),
codebase = CodyAgentCodebase.getInstance(project).getUrl().getNow(null),
Copy link
Contributor

Choose a reason for hiding this comment

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

this is great 🚀

@pkukielka pkukielka merged commit 4776bcd into main Oct 15, 2024
12 of 13 checks passed
@pkukielka pkukielka deleted the pkukielka/fix-repo-parsing branch October 15, 2024 09:47
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