Staging instance, all changes can be removed at any time

Skip to content

Improve snapshot branch target object

Jayesh requested to merge use-branch-by-name into master
  • Use the new storage method
  • Resolve to final branch target only on alias

query

fragment branchFragment on BranchConnection {
  nodes {
    type
    name {
      text
    }
    target {
      type
      swhid
      resolveChain {
        text
      }
      node {
        __typename
      }
    }
  }
}

query latestSnapshot {
  origin(url: "https://github.com/python/cpython") {
    latestSnapshot {
      head: branches(first: 1, nameInclude: "HEAD") {
      	...branchFragment
      }
      master: branches(first: 1, nameInclude: "refs/heads/main") {
      	...branchFragment
      }
    }
  }
}

Response

{
  "data": {
    "origin": {
      "latestSnapshot": {
        "head": {
          "nodes": [
            {
              "type": "alias",
              "name": {
                "text": "HEAD"
              },
              "target": {
                "type": "revision",
                "swhid": "swh:1:rev:e35e0f15eba64a1dcbab10bbbd2ce276e190dcfa",
                "resolveChain": [
                  {
                    "text": "HEAD"
                  },
                  {
                    "text": "refs/heads/main"
                  }
                ],
                "node": {
                  "__typename": "Revision"
                }
              }
            }
          ]
        },
        "master": {
          "nodes": [
            {
              "type": "revision",
              "name": {
                "text": "refs/heads/main"
              },
              "target": {
                "type": "revision",
                "swhid": "swh:1:rev:e35e0f15eba64a1dcbab10bbbd2ce276e190dcfa",
                "resolveChain": [
                  {
                    "text": "refs/heads/main"
                  }
                ],
                "node": {
                  "__typename": "Revision"
                }
              }
            }
          ]
        }
      }
    }
  }
}
Edited by Jayesh

Merge request reports

Loading