drupalorg-cli
drupalorg-cli copied to clipboard
"NID from argument is different from NID in issue branch name."
When attempting to generate a patch with this:
drupalorg issue:patch 3207680
I receive the error "NID from argument is different from NID in issue branch name.".
I am very sure that I'm providing the node ID of the drupal.org issue. What don't I understand about this command?
drupalorg tries to be clever and detect the NID from the branch name. (The NID in the command is optional.) So either the branch name is wrong in some way or drupalorg is picking up the wrong information. What is the the branch name? Also try to add -vvv to the command to get debug messages.
@hansfn Here's an example of another issue where the command throws the same error:
https://www.drupal.org/project/ultimenu/issues/3212881
I have the the 8.x-2.2
tag checked out locally as I determined here: https://git.drupalcode.org/project/ultimenu/-/tree/8.x-2.2
I've made the changes I need to make to the module, so I then run:
drupalorg issue:patch 3212881 -vvv
I see:
Box Requirements Checker
========================
> Using PHP 7.3.22
> PHP is using the following php.ini file:
/usr/local/etc/php/7.3/php.ini
> Checking Box requirements:
✔ The application requires the version ">=7.2" or greater.
✔ The application requires the extension "zlib".
✔ The package "composer/ca-bundle" requires the extension "openssl".
✔ The package "padraic/humbug_get_contents" requires the extension "openssl".
✔ The package "composer/ca-bundle" requires the extension "pcre".
✔ The package "dg/rss-php" requires the extension "simplexml".
[OK] Your system is ready to run the application.
NID from argument is different from NID in issue branch name.
If I exclude the nid argument from the command I see:
Box Requirements Checker
========================
> Using PHP 7.3.22
> PHP is using the following php.ini file:
/usr/local/etc/php/7.3/php.ini
> Checking Box requirements:
✔ The application requires the version ">=7.2" or greater.
✔ The application requires the extension "zlib".
✔ The package "composer/ca-bundle" requires the extension "openssl".
✔ The package "padraic/humbug_get_contents" requires the extension "openssl".
✔ The package "composer/ca-bundle" requires the extension "pcre".
✔ The package "dg/rss-php" requires the extension "simplexml".
[OK] Your system is ready to run the application.
Argument nid not provided. Trying to get it from current branch name.
Argument nid not provided and not able to get it from current branch name - aborting.
Thanks for your help. I'd love to get this working because it seems very convenient and I understand it's more correct, but for the issue in the example I'll move forward with creating a patch using git diff
as I've always done.
hey, all! Sorry I let this hang. I'm going to get some time to get this back up to speed
Ah! I'm one step closer. I realized I was supposed to be creating a feature branch that included the node id of the issue per https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupal/making-a-patch#s-prepare-the-local-repository
So I ran:
git checkout -b 3212881-array-merge-expects-array
drupalorg issue:patch -vvv
I saw:
Box Requirements Checker
========================
> Using PHP 7.3.22
> PHP is using the following php.ini file:
/usr/local/etc/php/7.3/php.ini
> Checking Box requirements:
✔ The application requires the version ">=7.2" or greater.
✔ The application requires the extension "zlib".
✔ The package "composer/ca-bundle" requires the extension "openssl".
✔ The package "padraic/humbug_get_contents" requires the extension "openssl".
✔ The package "composer/ca-bundle" requires the extension "pcre".
✔ The package "dg/rss-php" requires the extension "simplexml".
[OK] Your system is ready to run the application.
Argument nid not provided. Trying to get it from current branch name.
Cache MISS for node:3212881
Patch written to /Users/blt/Sites/drupal-modules/ultimenu/warning_array_merge-3212881-2.patch
This appeared to be successful, but unfortunately the patch file is completely empty.
@maskedjellybean Could it be that you have forgotten to actually commit your changes (to the local issue branch)? If I don't commit the changes, I see the changes displayed in the terminal but not written to the patch file. Very confusing, but the documentation says "Generate a patch for the issue from committed local changes".
@hansfn Phew! You're right. I had to commit the changes first. I need to learn how to read. I figured that this used git diff > something.patch
behind the scenes, and so I wouldn't want to commit my changes.