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

On PR to submodule parent package was forked instead of submodule #6492

Open
3y3 opened this issue Nov 19, 2024 · 1 comment · Fixed by #6565
Open

On PR to submodule parent package was forked instead of submodule #6492

3y3 opened this issue Nov 19, 2024 · 1 comment · Fixed by #6565
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verification-found Issue verification failed
Milestone

Comments

@3y3
Copy link

3y3 commented Nov 19, 2024

  • Extension version: v0.100.1
  • VSCode Version: 1.9.3
  • OS: MacOS
  • Repository Clone Configuration (single repository/fork of an upstream repository): single repository with submodules
  • Github Product (Github.com/Github Enterprise version x.x.x): Github.com

Steps to Reproduce:

tl;dr: On PR create for submodule, extension will fork main repository instead of submodule.
Looks like it's the same as
#4487
#5181

We found issue on diplodoc metapackage. But it is reproducible on any repo with submodules.

Prerequisites:
Metapackage - organisation owned repo with submodules and enabled codespaces.
Submodule - any organisation owned repo linked to metapackage.
Alice - user out of organization scope.

  1. Create codespace for metapackage and open it in browser VSCode
  2. Pull submodules. We use this small script to pull all submodules in one time, but looks like there is nothing special.
  3. Make some change to submodule.
  4. Create new branch in submodule. Commit changes (with help of Github Pull Request Extension)
  5. Push the button "Create Pull Request" Image
  6. Check autofilled fields (looks like at this step all is normal: BASE and MERGE fields refers to submodule branches)
  7. Push "Create" button.
  8. VSCode notifies Alice about restriction to pull directly to organization and proposes to create fork.
  9. Submit to fork submodule
    9.1 Current behaviour: fork for metapackage was created, pr flow was broken on next step with reasonable error.
    Image
    9.2 Expected behaviour: fork for submodule was created, pr flow finished succesefully.
  10. At second try to push "Create" button error message was changed to
    Image
@alexr00 alexr00 self-assigned this Dec 2, 2024
@alexr00 alexr00 added the bug Issue identified by VS Code Team member as probable bug label Dec 2, 2024
@alexr00 alexr00 added this to the January 2025 milestone Dec 2, 2024
@chrmarti chrmarti pinned this issue Jan 30, 2025
@chrmarti chrmarti added the verified Verification succeeded label Jan 30, 2025
@chrmarti
Copy link
Contributor

Tried with https://github.com/chrmarti/test-main-repo and https://github.com/chrmarti/test-sub-repo. It forked the submodule as https://github.com/notquiteme/test-sub-repo and updated the git remotes to origin and upstream, but then failed.

Image

PR output channel:

2025-01-30 15:45:53.119 [error] GitHubRepository+1.1> Error querying GraphQL API: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.. 
2025-01-30 15:45:53.119 [error] GitHubRepository+1.1> Error querying GraphQL API: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.. 
2025-01-30 15:45:53.119 [error] GitHubRepository+1.1> Fetching pull request templates failed: Error: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.
2025-01-30 15:45:53.119 [error] GitHubRepository+1.1> Fetching pull request templates failed: Error: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.
2025-01-30 15:45:53.272 [info] CreatePullRequestViewProvider> Initializing "create" view: {"canModifyBranches":true,"defaultBaseRemote":{"owner":"chrmarti","repositoryName":"test-sub-repo"},"defaultBaseBranch":"main","defaultCompareRemote":{"owner":"chrmarti","repositoryName":"test-sub-repo"},"defaultCompareBranch":"raspy-whitefish","defaultTitle":"change","defaultDescription":"","baseHasMergeQueue":false,"remoteCount":2,"allowAutoMerge":false,"mergeMethodsAvailability":{"merge":false,"squash":false,"rebase":false},"autoMergeDefault":false,"createError":"","labels":[],"isDraftDefault":false,"isDarkTheme":true,"creating":false,"initializeWithGeneratedTitleAndDescription":false,"preReviewState":0,"reviewing":false}
2025-01-30 15:45:57.086 [error] GitHubRepository+1.1> Error querying GraphQL API: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.. 
2025-01-30 15:45:57.086 [error] GitHubRepository+1.1> Fetching pull request templates failed: Error: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.
2025-01-30 15:46:39.879 [info] CreatePullRequestViewProvider> Found push remote origin for chrmarti/test-sub-repo and branch raspy-whitefish
2025-01-30 15:47:01.383 [info] Review+1> Validate state in progress
2025-01-30 15:47:01.383 [info] Review+1> Validating state...
2025-01-30 15:47:01.405 [info] Found GitHub remote for folder /Users/chrmarti/Development/repos/test-main-repo/test-sub-repo
2025-01-30 15:47:01.437 [info] Review+1> Queuing additional validate state
2025-01-30 15:47:01.869 [error] GitHubRepository+1.1> Error querying GraphQL API: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.. 
2025-01-30 15:47:01.869 [error] GitHubRepository+1.1> Error querying GraphQL API: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.. 
2025-01-30 15:47:01.869 [error] GitHubRepository+1.1> Fetching pull request templates failed: Error: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.
2025-01-30 15:47:01.869 [error] GitHubRepository+1.1> Fetching pull request templates failed: Error: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.
2025-01-30 15:47:01.871 [info] FolderRepositoryManager+1> Trying to use globalState for assignableUsers.
2025-01-30 15:47:01.891 [info] FolderRepositoryManager+1> Using globalState assignableUsers for 1.
2025-01-30 15:47:01.900 [info] Review+1> No matching pull request metadata found locally for current branch raspy-whitefish
2025-01-30 15:47:01.927 [info] Review+1> No matching pull request metadata found on GitHub for current branch raspy-whitefish
2025-01-30 15:47:01.931 [info] Review+1> Validating state...
2025-01-30 15:47:01.932 [info] Found GitHub remote for folder /Users/chrmarti/Development/repos/test-main-repo/test-sub-repo
2025-01-30 15:47:02.364 [info] FolderRepositoryManager+1> Trying to use globalState for assignableUsers.
2025-01-30 15:47:02.369 [info] FolderRepositoryManager+1> No globalState for assignableUsers.
2025-01-30 15:47:02.386 [info] Review+1> No matching pull request metadata found locally for current branch raspy-whitefish
2025-01-30 15:47:02.410 [info] Review+1> No matching pull request metadata found on GitHub for current branch raspy-whitefish
2025-01-30 15:47:02.552 [error] GitHubRepository+1.2> Error querying GraphQL API: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.. 
2025-01-30 15:47:02.552 [error] GitHubRepository+1.2> Fetching pull request templates failed: Error: GraphQL error: Could not resolve to a Repository with the name 'chrmarti/.github'.

Git output channel:

2025-01-30 15:45:58.312 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [15ms]
2025-01-30 15:45:58.317 [info] > git status -z -uall [21ms]
2025-01-30 15:46:34.708 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [33ms]
2025-01-30 15:47:01.347 [info] > git remote rename origin upstream [39ms]
2025-01-30 15:47:01.363 [info] > git config --get commit.template [15ms]
2025-01-30 15:47:01.365 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [15ms]
2025-01-30 15:47:01.380 [info] > git status -z -uall [14ms]
2025-01-30 15:47:01.380 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [13ms]
2025-01-30 15:47:01.396 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [13ms]
2025-01-30 15:47:01.397 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [15ms]
2025-01-30 15:47:01.398 [info] > git diff --name-status -z --diff-filter=ADMR upstream/main...raspy-whitefish [13ms]
2025-01-30 15:47:01.398 [info] > git remote add origin https://github.com/notquiteme/test-sub-repo.git [14ms]
2025-01-30 15:47:01.411 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [14ms]
2025-01-30 15:47:01.421 [info] > git config --get commit.template [22ms]
2025-01-30 15:47:01.421 [info] > git log --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z upstream/main..raspy-whitefish [18ms]
2025-01-30 15:47:01.421 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [21ms]
2025-01-30 15:47:01.425 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [13ms]
2025-01-30 15:47:01.434 [info] > git status -z -uall [12ms]
2025-01-30 15:47:01.435 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [12ms]
2025-01-30 15:47:01.439 [info] > git show -s --decorate=full --shortstat --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z df18c7c87ee666df9a06f8661e42b337abb4c85c [13ms]
2025-01-30 15:47:01.463 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [26ms]
2025-01-30 15:47:01.464 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [28ms]
2025-01-30 15:47:01.480 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [16ms]
2025-01-30 15:47:01.500 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [15ms]
2025-01-30 15:47:01.513 [info] > git show -s --decorate=full --shortstat --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z df18c7c87ee666df9a06f8661e42b337abb4c85c [12ms]
2025-01-30 15:47:01.654 [info] > git diff --name-status -z --diff-filter=ADMR upstream/main...raspy-whitefish [14ms]
2025-01-30 15:47:01.655 [info] > git log --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z upstream/main..raspy-whitefish [14ms]
2025-01-30 15:47:01.899 [info] > git config --get --local branch.raspy-whitefish.github-pr-owner-number [26ms]
2025-01-30 15:47:01.899 [warning] [Git][config] git config failed: Failed to execute git
2025-01-30 15:47:01.914 [info] > git config --get --local branch.raspy-whitefish.remote [14ms]
2025-01-30 15:47:01.914 [warning] [Git][config] git config failed: Failed to execute git
2025-01-30 15:47:01.927 [info] > git config --get --local branch.raspy-whitefish.merge [12ms]
2025-01-30 15:47:01.927 [warning] [Git][config] git config failed: Failed to execute git
2025-01-30 15:47:02.091 [info] > git push -u origin raspy-whitefish [652ms]
2025-01-30 15:47:02.092 [info] remote: Repository not found.
fatal: repository 'https://github.com/notquiteme/test-sub-repo.git/' not found
2025-01-30 15:47:02.116 [info] > git config --get commit.template [22ms]
2025-01-30 15:47:02.117 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [22ms]
2025-01-30 15:47:02.131 [info] > git status -z -uall [13ms]
2025-01-30 15:47:02.132 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [13ms]
2025-01-30 15:47:02.150 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [15ms]
2025-01-30 15:47:02.151 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [18ms]
2025-01-30 15:47:02.152 [info] > git diff --name-status -z --diff-filter=ADMR upstream/main...raspy-whitefish [16ms]
2025-01-30 15:47:02.152 [info] > git log --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z upstream/main..raspy-whitefish [15ms]
2025-01-30 15:47:02.164 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [13ms]
2025-01-30 15:47:02.179 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/raspy-whitefish refs/remotes/raspy-whitefish [13ms]
2025-01-30 15:47:02.191 [info] > git show -s --decorate=full --shortstat --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z df18c7c87ee666df9a06f8661e42b337abb4c85c [11ms]
2025-01-30 15:47:02.385 [info] > git config --get --local branch.raspy-whitefish.github-pr-owner-number [19ms]
2025-01-30 15:47:02.385 [warning] [Git][config] git config failed: Failed to execute git
2025-01-30 15:47:02.398 [info] > git config --get --local branch.raspy-whitefish.remote [12ms]
2025-01-30 15:47:02.398 [warning] [Git][config] git config failed: Failed to execute git
2025-01-30 15:47:02.410 [info] > git config --get --local branch.raspy-whitefish.merge [11ms]
2025-01-30 15:47:02.410 [warning] [Git][config] git config failed: Failed to execute git
2025-01-30 15:47:02.552 [info] > git ls-files --stage -- /Users/chrmarti/Development/repos/test-main-repo/test-sub-repo/README.md [15ms]
2025-01-30 15:47:02.566 [info] > git cat-file -s f68dbbb077370b788f0c6733f18d54abd75069a5 [13ms]
2025-01-30 15:47:02.579 [info] > git show --textconv :README.md [12ms]
❯ git remote -v
origin  https://github.com/notquiteme/test-sub-repo.git (fetch)
origin  https://github.com/notquiteme/test-sub-repo.git (push)
upstream        https://github.com/chrmarti/test-sub-repo.git (fetch)
upstream        https://github.com/chrmarti/test-sub-repo.git (push)

@chrmarti chrmarti reopened this Jan 30, 2025
@chrmarti chrmarti added verification-found Issue verification failed and removed verified Verification succeeded labels Jan 30, 2025
@alexr00 alexr00 modified the milestones: January 2025, February 2025 Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verification-found Issue verification failed
Projects
None yet
3 participants