How to update PR to METADATA.jl?

Scenario:

  1. Tag a new version of a package and run PkgDev.publish() to create a PR to METADATA.jl.
  2. Collect comments and do changes to your package.
  3. Add a new commit to your package.
  4. Update PR.

Steps 1 to 3 are clear, but what is the supposed way to perform step 4? So far the best approach I came with is to:

  1. Run PkgDev.tag("MyPackage", v"<same-version>"; force=true) to replace the tag locally.
  2. Run git push -f origin v<same-version> to push updated tag to GitHub.
  3. Run PkgDev.publish() to create a new PR with renewed tag.

But I suspect posting a new PR each time I have changes is time-consuming for maintainers.

An alternative way is to:

  1. Go to PR’s page on GitHub.
  2. Manually modify sha1 file to include new git hash.

But this creates a new commit each time an edit is done.

So what is the intended way to update an existing PR?

I used the Attobot:
https://github.com/attobot/attobot/blob/master/README.md

I really felt it was easy to use.

If you look at the PR, it will tell you which branch of your METADATA fork the PR is for. Check out that branch and make the edits.

Looks promising! I’ll definitely give it a try for my next package!

Maybe you have an example of how to checkout & push back the branch of that PR? In particular, I’m having a hard time fixing this PR and here’s what I have tried so far (from METADATA.jl directory):

git fetch origin  
git fetch dfdx

git checkout pull-request/2daecf74
# error: pathspec 'pull-request/2daecf74' did not match any file(s) known to git.

git checkout dfdx/pull-request/2daecf74
# error: pathspec 'dfdx/pull-request/2daecf74' did not match any file(s) known to git.

git checkout remotes/dfdx/pull-request/2daecf74
# error: pathspec 'remotes/dfdx/pull-request/2daecf74' did not match any file(s) known to git.

git checkout origin/pull-request/2daecf74
# HEAD is now at 6ba76c45c... Update sha1
<do edits>
git push origin/pull-request/2daecf74
# fatal: You are not currently on a branch.
# To push the history leading to the current (detached HEAD)
# state now, use

     git push origin/pull-request/2daecf74 HEAD:<name-of-remote-branch>

This is why I use GitKraken. You set it up with your remotes and it will be visually way to find the branch.

Updated instructions for Julia 1.0/Pkg3 if you used Attobot (the Pkg3 bot to assist with PRs):

Hi Alec, thanks for sending this out. Can we now merge Pkg3 ready packages (e.g. through Attobot)? Until a few weeks ago the JuliaCIBot would fail and it was suggested not to include Project.toml files.

I’m definitely not well versed on the whole process - I had tried to submit a PR for a new package and got pointed in a different direction than what the earlier history of this thread suggested. I wanted to share an updated tip.

That all being said, I think it;s fine to merge Pkg3 ready packages. One of the maintainers suggested I remove the Project.toml file as it was making CI fail as well, though.

Thanks, i’ll ask a broader question on Discourse in a few days.