question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

git.origin -> git.github_pr_destination fails when specifying a SHA-1 `ref` on the origin

See original GitHub issue

I’m attempting to write a macro for a workflow which will take a public Git SoT (git.origin is necessary, since this can be sources other than github or gerrit). I’d like to submit this import as a PR to a private github destination (via git.github_pr_destination).

The workflow that gets generated is pretty simple:

    core.workflow(
        name = "some_foo_name",
        mode = "SQUASH",
        origin = git.origin(
            url = url,
            ref = "someCommitHash",
        ),
        destination = git.github_pr_destination(
            url = private_url,
            destination_ref = "master",
            pr_branch = "import/some_foo_name/${CONTEXT_REFERENCE}",
        ),
        <snip...>

However, when running this workflow, I get a error stating that I need to specify the pr_branch for this:

ERROR: git.github_pr_destination is incompatible with the current origin. Origin has to be able to provide the contextReference or use '--github-destination-pr-branch' flag

Am I going about this incorrectly? What is a more idiomatic way to do this?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
sudoforgecommented, May 10, 2020

Actually, after reading your comment, I think there may be a slight miscommunication. I’m attempting to specify a SHA-1 for a git.origin, not a git.github_pr_origin.

0reactions
hsudhofcommented, Aug 18, 2020

Let me see about gazelle, this is something that might fit into a module; at the very least we would be open to accepting a contribution for gazelle support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git push error: "origin does not appear to be a git repository"
But I don't see any source code on the external USB Drive. I see a directory structure with directories like branches, hooks, info,...
Read more >
Git References - Git SCM
When you run git commit , it creates the commit object, specifying the parent of that commit object to be whatever SHA-1 value...
Read more >
git-show-ref Documentation - Git
Displays references available in a local repository along with the associated commit IDs. Results can be filtered using a pattern and tags can...
Read more >
hash-function-transition Documentation - Git
Migrate Git from SHA-1 to a stronger hash function. Background ... still possesses the other properties such as fast object lookup and safe...
Read more >
git-fetch Documentation - Git
When no remote is specified, by default the origin remote will be used, ... be a glob on ref names, a ref, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found