scripts: validate the first Comments-URI entry #2233

pull grandpig wants to merge 1 commits into bitcoin:master from grandpig:master changing 1 files +1 −1
  1. grandpig commented at 10:46 AM on August 3, 2026: contributor

    The Comments-URI validation condition was reversed when the field was made optional.

    $found{'Comments-URI'} is incremented only after the current header line has been processed. As a result, the existing condition skipped validation for the first entry and applied it to continuation entries instead.

    This allowed a nonstandard first Comments-URI to pass, while rejecting a valid external discussion URI following the standard Comments wiki URI.

    Restore the original condition so that only the first entry must match:

    https://github.com/bitcoin/bips/wiki/Comments:BIP-NNNN

    Additional continuation entries remain unrestricted.

  2. murchandamus added the label CI on Aug 5, 2026
  3. in scripts/buildtable.pl:200 in e0e377e9ba outdated
     196 | @@ -197,7 +197,7 @@
     197 |  				die "Unacceptable license $val in $fn" unless exists $AcceptableLicenses{$val} or ($val eq 'PD' and exists $GrandfatheredPD{$bipnum}) or ($val eq 'CC-BY-SA-4.0' and exists $GrandfatheredCCBySA{$bipnum});
     198 |  			}
     199 |  		} elsif ($field eq 'Comments-URI') {
     200 | -			if ($found{'Comments-URI'}) {
     201 | +			if (not $found{'Comments-URI'}) {
    


    murchandamus commented at 10:27 PM on August 5, 2026:

    This change makes sense to me. I see that I introduced this mistake in #1820. Thanks for catching that.

    It’s not clear to me why we should be adding the second script to our build actions. It seems to be a proof that the bugfix change is correct, but if that’s the case adding it to the build actions going forth seems unnecessary.


    grandpig commented at 2:31 PM on August 12, 2026:

    @murchandamus Thanks, that makes sense.

    I removed the standalone regression test and its build action invocation, leaving only the one-line fix.

  4. scripts: validate the first Comments-URI entry
    Signed-off-by: grandpig <grandpig@outlook.com>
    6d5fc819a6
  5. grandpig force-pushed on Aug 12, 2026
  6. grandpig commented at 2:32 PM on August 12, 2026: contributor

    @murchandamus Thank you for your reply. Please review it again.

  7. murchandamus commented at 12:05 AM on August 15, 2026: member

    LGTM

  8. murchandamus merged this on Aug 15, 2026
  9. murchandamus closed this on Aug 15, 2026

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-24 03:54 UTC