Skip to content

Issue queries have the wrong owner #2836

@TBBle

Description

@TBBle

Issue Type: Bug

Given my .git/config

[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[remote "origin"]
	url = https://github.com/Microsoft/hcsshim
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
[remote "tbble"]
	url = git@github.com:TBBle/hcsshim.git
	fetch = +refs/heads/*:refs/remotes/tbble/*
[branch "base-layer-manipulation"]
	remote = tbble
	merge = refs/heads/base-layer-manipulation
	github-pr-owner-number = "microsoft#hcsshim#901"
[branch "hack-base-layer-manipulation-with-128layers-test"]
	remote = tbble
	merge = refs/heads/hack-base-layer-manipulation-with-128layers-test

and GitHub Pull Requests config:

  "githubPullRequests.defaultMergeMethod": "rebase",
  "githubPullRequests.logLevel": "debug",
  "githubIssues.queries": [
    {
      "label": "Created Issues",
      "query": "author:${user} state:open repo:${owner}/${repository} sort:created-desc"
    }
  ]

I do not see my created issues in the upstream repo.

Looking at the debug logs when I refresh the issue list, I can see

[Debug 1626249434.399s] GitHubRepository> Fetch metadata - enter
[Debug 1626249434.746s] GitHubRepository> Fetch metadata TBBle/hcsshim - done
[Debug 1626249434.746s] GitHubRepository> Fetch metadata - enter
[Debug 1626249434.746s] GitHubRepository> Fetch metadata TBBle/hcsshim - done
[Debug 1626249434.746s] GitHubRepository> Fetch issues with query - enter
[Debug 1626249434.746s] GitHubRepository> Fetch max issue - enter
[Debug 1626249434.747s] GraphQL> Request: {
  "query": {
    "kind": "Document",
    "definitions": [
      {
        "kind": "OperationDefinition",
        "operation": "query",
        "name": {
          "kind": "Name",
          "value": "Issues"
        },
...
  },
  "variables": {
    "query": "author:TBBle state:open repo:TBBle/hcsshim sort:created-desc type:issue"
  }
}

So clearly it's ignoring the githubPullRequests.remotes setting (defaulted, so not in my config), and is looking for issues in my fork of the project, not the upstream remote where my PRs and their associated issues live.

If I replace ${owner} with literal Microsoft or microsoft in my config, the correct issues appear, but obviously that's not a useful solution that's rational if I'm contributing to any other team's project.

I'm pretty sure this is a bug, because immediately after the above query (and before it responds), the following request/response happens

[Debug 1626250504.544s] GraphQL> Request: {
  "query": {
    "kind": "Document",
    "definitions": [
      {
        "kind": "OperationDefinition",
        "operation": "query",
        "name": {
          "kind": "Name",
          "value": "MaxIssue"
        },
...
      }
    }
  },
  "variables": {
    "owner": "microsoft",
    "name": "hcsshim"
  }
}
[Debug 1626250504.918s] GraphQL> Response: {
  "data": {
    "repository": {
      "issues": {
        "edges": [
          {
            "node": {
              "number": 1073,
              "__typename": "Issue"
            },
            "__typename": "IssueEdge"
          }
        ],
        "__typename": "IssueConnection"
      },
      "__typename": "Repository"
    }
  },
  "loading": false,
  "networkStatus": 7,
  "stale": false
}
[Debug 1626250504.918s] GitHubRepository> Fetch max issue - done

which shows Fetch max issue is using the correct owner, and finds 1073 issues.

And to round-off the logs

[Debug 1626250504.99s] GraphQL> Response: {
  "data": {
    "search": {
      "issueCount": 0,
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": null,
        "__typename": "PageInfo"
      },
      "edges": [],
      "__typename": "SearchResultItemConnection"
    }
  },
  "loading": false,
  "networkStatus": 7,
  "stale": false
}
[Debug 1626250504.99s] GitHubRepository> Fetch issues with query - done

So somehow Fetch issues with query queries against the wrong repository, despite a nested Fetch max issue querying against the right repository.

The Fetch max issue happening at the same time might be unrelated. Brief poking around in the source doesn't show me that one would trigger the other, but it was brief.

Extension version: 0.28.0
VS Code version: Code 1.58.1 (2aeda6b18e13c4f4f9edf6667158a6b8d408874b, 2021-07-13T06:58:28.115Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 x 3600)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.95GB (20.75GB free)
Process Argv --file-uri file:///c%3A/Users/paulh/go/src/github.com/containerd/containerd/containerd.code-workspace --crash-reporter-id 90ab2d5a-d8a2-4286-94a6-1a9a88e9642b
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
pythonvspyt678:30270856
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30311713
vspre833:30321513
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30322571
pythondataviewer:30285071
vscus158:30321503
pythonvsuse255:30335481
vscod805:30301674
pythonvspyt200:30331937
vscextlang:30333561
binariesv615:30325510
vsccppwtct:30329789
bridge0708:30335490

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions