metanorma / bipm-si-brochure

SI Brochure edition 9, semantic encoded version (WARNING: DRAFT)
3 stars 0 forks source link

Incorrect SI Brochure docnumber #232

Closed andrew2net closed 8 months ago

andrew2net commented 8 months ago

After generating documents with bundle exec metanorma site generate --agree-to-terms the _site/documents/si-brochure-en.rxl, _site/documents/si-brochure-fr.rxl, _site/documents/sib-a4-en.rxl, and _site/documents/sib-a4-fr.rxl contain <docnumber>Brochure</docnumber>. These documents had docnumbers SI Brochure and SI Brochure, Appendix 4 two weeks ago. This causes ID parsing error: https://github.com/relaton/relaton-data-bipm/actions/runs/8300934647/job/22719924651#step:7:1414

ronaldtse commented 8 months ago

Looks like a bug with document id generation.

ronaldtse commented 8 months ago

@opoudjis says it’s his bug in the collections code.

opoudjis commented 8 months ago

... I did?

Let me try to replicate locally...

opoudjis commented 8 months ago

Hm. sib-a4-en has :docnumber: Brochure, and it's had it since https://github.com/metanorma/bipm-si-brochure/commit/d936eb7cf80fd16d5eb83693805ae3a9e693617c , two years ago; before that, it was blank. The other documents also have :docnumber: Brochure, and always did...

No open branch has a different docnumber.

I have refactored the generation of document identifiers, and it was two weeks ago, but I'm at a loss to explain how SI was being added as a prefix by code. Investigating further.

opoudjis commented 8 months ago

I cannot replicate, and older versions I have lying around do not display that behaviour.

So si-brochure-fr.rxl, generated May 2023, has:

<docidentifier type="BIPM">BIPM Brochure</docidentifier>
<docidentifier type="ISBN">978-92-822-2272-0</docidentifier>
<docnumber>Brochure</docnumber>

sib-a4-fr.xml just generated has

<docidentifier type="BIPM" language="fr">BIPM Brochure Annexe 4</docidentifier>
<docidentifier type="BIPM" language="en">BIPM Brochure Appendix 4</docidentifier>
<docnumber>Brochure</docnumber>

@andrew2net I hate to say it, but I don't see how <docnumber>SI Brochure</docnumber> could ever have been generated. /bibdata/docnumber just replicates the value given in :docnumber:, and I have no evidence that value in the source files was ever anything but Brochure.

I am seeing that your code expects to see SI Brochure there, I just can't reproduce what has happened to put that "SI" in there. And I notice that other documents put the SI explicitly in the attribute; e.g. bipm-si-brochure/sources/mep-ampere-definition-en.adoc explicitly has:

:docnumber: SI MEP A1

and has had it since Oct 2020: https://github.com/metanorma/bipm-si-brochure/commit/3397df7bb7fd93139ab755d3f38ec85643491bb1

I don't know what's happened, I don't know what's changed, and I don't know why I'm getting different results to you Andrej, but my recommendation is that we simply change the :docnumber: attribute for those documents from Brochure to SI Brochure.

opoudjis commented 8 months ago

I've reviewed the past month of commits to metanorma-bipm, and can't find anything that might have injected an SI prefix to docnumber or docidentifier. Sorry, I can't work this out, and if something was injecting SI before a supplied docnumber attribute, then honestly, it should not have been...