Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate XSLT update in gems #230

Closed
1 task done
CAMOBAP opened this issue Jul 10, 2020 · 19 comments
Closed
1 task done

Automate XSLT update in gems #230

CAMOBAP opened this issue Jul 10, 2020 · 19 comments
Assignees

Comments

@CAMOBAP
Copy link
Contributor

CAMOBAP commented Jul 10, 2020

Intro

Thanks to @opoudjis for the suggestion of improvement which can help us to keep xslt up-to-date in our gems

Problem

We need to always keep eye on xslt update & propagate them to gems

Proposed solution

Implement separate GHA workflow which will be triggered by release (or other even on this repo), the steps of this flow

  • build XSLTs with make xslts
  • commit xslts which was generated according to the mapping bellow:
     cp xslt/iec.international-standard.xsl ../metanorma-iec/lib/isodoc/iec
     cp xslt/iso.international-standard.xsl ../metanorma-iso/lib/isodoc/iso
     cp xslt/iso.amendment.xsl ../metanorma-iso/lib/isodoc/iso
     cp xslt/itu.recommendation.xsl ../metanorma-itu/lib/isodoc/itu
     cp xslt/itu.recommendation-annex.xsl ../metanorma-itu/lib/isodoc/itu
     cp xslt/itu.resolution.xsl ../metanorma-itu/lib/isodoc/itu
     cp xslt/ogc.abstract-specification-topic.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.best-practice.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.change-request-supporting-document.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.community-practice.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.community-standard.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.discussion-paper.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.engineering-report.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.policy.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.reference-model.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.release-notes.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.standard.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.test-suite.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.user-guide.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.white-paper.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/ogc.other.xsl ../metanorma-ogc/lib/isodoc/ogc
     cp xslt/un.plenary.xsl ../metanorma-unece/lib/isodoc/un
     cp xslt/un.plenary-attachment.xsl ../metanorma-unece/lib/isodoc/un
     cp xslt/un.recommendation.xsl ../metanorma-unece/lib/isodoc/un
     cp xslt/csd.standard.xsl ../metanorma-csd/lib/isodoc/cc
     cp xslt/csa.standard.xsl ../metanorma-csand/lib/isodoc/csa
     cp xslt/rsd.standard.xsl ../metanorma-rsd/lib/isodoc/ribose
     cp xslt/m3d.report.xsl ../metanorma-m3d/lib/isodoc/m3aawg
     cp xslt/gb.recommendation.xsl ../metanorma-gb/lib/isodoc/gb
     cp xslt/iho.specification.xsl ../metanorma-iho/lib/isodoc/iho
     cp xslt/iho.standard.xsl ../metanorma-iho/lib/isodoc/iho
    

Open questions

  • Which event should trigger xslts update? Release event or some else even? - Use push: on master as trigger event

cc @opoudjis @Intelligent2013 @ronaldtse

@CAMOBAP CAMOBAP self-assigned this Jul 10, 2020
@CAMOBAP CAMOBAP added this to To do in Alexander Bobrikovich via automation Jul 10, 2020
@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Jul 10, 2020

@Intelligent2013 please let me know how do you think generally about the topic? Also maybe you have something to say for the open question?

@Intelligent2013
Copy link
Contributor

@CAMOBAP when I update XSLTs, I change them in a separate branch to make sure that all PDF generate ok. After merge branch to master, XSLTs in xslt_src folder are ready to further use. I don't use a git versions. So I think you can triggered workflow on push or merging to master branch.

@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Jul 10, 2020

@Intelligent2013 thanks for your input, push to master as the event, works perfectly also

@opoudjis
Copy link
Contributor

@CAMOBAP So has this functionality been implemented? That behaviour does not seem to be happening...

@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Aug 14, 2020

@opoudjis hmm, let me check

@Intelligent2013
Copy link
Contributor

Ping @CAMOBAP.

@ronaldtse
Copy link
Contributor

@Intelligent2013 I think @CAMOBAP is on holiday, he's returning the week after.

@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Feb 7, 2021

@opoudjis @ronaldtse @Intelligent2013

  1. Should we rename the files below?
  • xslt_src/csd.standard.core.xsl -> xslt_src/cc.standard.core.xsl
  • xslt_src/csd.standard.presentation.core.xsl -> xslt_src/cc.standard.presentation.core.xsl
  • xslt_src/m3d.report.core.xsl -> xslt_src/m3aawg.report.core.xsl
  • xslt_src/m3d.report.presentation.core.xsl -> xslt_src/m3aawg.report.presentation.core.xsl
  • xslt_src/mpfd.circular.core.xsl -> xslt_src/mpfa.circular.core.xsl
  • xslt_src/mpfd.circular.presentation.core.xsl -> xslt_src/mpfa.circular.presentation.core.xsl
  • xslt_src/mpfd.compliance-standards-for-mpf-trustees.core.xsl -> xslt_src/mpfa.compliance-standards-for-mpf-trustees.core.xsl
  • xslt_src/mpfd.compliance-standards-for-mpf-trustees.presentation.core.xsl -> xslt_src/mpfa.compliance-standards-for-mpf-trustees.presentation.core.xsl
  • xslt_src/mpfd.guidelines.core.xsl -> xslt_src/mpfa.guidelines.core.xsl
  • xslt_src/mpfd.guidelines.presentation.core.xsl -> xslt_src/mpfa.guidelines.presentation.core.xsl
  • xslt_src/mpfd.standards.core.xsl -> xslt_src/mpfa.standards.core.xsl
  • xslt_src/mpfd.standards.presentation.core.xsl -> xslt_src/mpfa.standards.presentation.core.xsl
  • xslt_src/mpfd.supervision-of-mpf-intermediaries.core.xsl -> xslt_src/mpfa.supervision-of-mpf-intermediaries.core.xsl
  • xslt_src/mpfd.supervision-of-mpf-intermediaries.presentation.core.xsl -> xslt_src/mpfa.supervision-of-mpf-intermediaries.presentation.core.xsl
  • xslt_src/rsd.standard.core.xsl -> xslt_src/ribose.standard.core.xsl
  • xslt_src/rsd.standard.presentation.core.xsl -> xslt_src/ribose.standard.presentation.core.xsl
  1. As far as I understand we should copy any produced xslt/*.xsl except *.presentation.*, is that correct?

@ronaldtse
Copy link
Contributor

ronaldtse commented Feb 7, 2021

@CAMOBAP rename: yes please, an excellent find 😉 Also need to ping @opoudjis that the XSL names will change.

As far as I understand we should copy any produced xslt/*.xsl except .presentation., is that correct?

@Intelligent2013 can you please help answer? Thanks!

@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Feb 7, 2021

rename: yes please, an excellent find 😉 Also need to ping @opoudjis that the XSL names will change.

@ronaldtse @opoudjis I can change it in specific processors too. To be on the same page, should I care about potential backward compatibility issues or anything what should I check after this rename?

@ronaldtse
Copy link
Contributor

I can change it in specific processors too.

@CAMOBAP thank you. I don't think there are side effects but let's see what @opoudjis says.

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Feb 7, 2021

@CAMOBAP I didn't look at changes in PR yet, therefore answer about current situation.

  1. Should we rename the files below?

Each xslt filename has a parts related to xml structure. For example, csd.standard.presentation.core.xsl:

These rules are using for PDF generating in mn-native-pdf in gh-pages branch.

If we change csd to cc, then we need some external determined rules for relationship between xslt filename and source xml file.

  1. As far as I understand we should copy any produced xslt/*.xsl except .presentation., is that correct?

@CAMOBAP in xslt_src folder there are two kind of core.xsl files:

  • with presentation suffix - it should be used for PDF
  • without presentation suffix - obsoleted xslt files and can be omitted.

So in xslt/*presentation.xsl should be used.

@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Feb 7, 2021

@Intelligent2013 thanks for the explanation, I asked about XSLT with presentation suffix because I didn't manage to find them in our metanorma-* processors, maybe @opoudjis can comment on this also.

@opoudjis
Copy link
Contributor

opoudjis commented Feb 8, 2021

Yes, I rename the *.presentation suffixes to strip them when I copy them into the individual gems.

There are indeed rules for allocating the multiple XSLTs of a flavour; they are often but not always doctype. The rules are implemented in the lib/isodoc/*/pdf_converter.rb files.

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Feb 9, 2021

I propose to remove non-presentation xslt in mn-native-pdf, and rename *presentation.core.xsl into *core.xsl (+ update Makefile).

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Feb 9, 2021

@CAMOBAP I'll do it in feature/update-xslts-in-processors branch if do you mind.

@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Feb 9, 2021

I propose to remove non-presentation xslt in mn-native-pdf, and rename *presentation.core.xsl into *core.xsl (+ update Makefile).

@Intelligent2013 Good idea!

@CAMOBAP I'll do it in feature/update-xslts-in-processors branch if do you mind.

Yes please, just let me know once you are done

Intelligent2013 added a commit that referenced this issue Feb 9, 2021
@Intelligent2013
Copy link
Contributor

@CAMOBAP Done.

CAMOBAP added a commit to metanorma/metanorma-mpfa that referenced this issue Feb 9, 2021
ronaldtse pushed a commit to metanorma/metanorma-cc that referenced this issue Feb 10, 2021
ronaldtse pushed a commit to metanorma/metanorma-m3aawg that referenced this issue Feb 10, 2021
CAMOBAP added a commit to metanorma/metanorma-ribose that referenced this issue Feb 10, 2021
CAMOBAP added a commit that referenced this issue Feb 10, 2021
…sors

#230 add xslt update step into ubuntu worflow file
CAMOBAP added a commit that referenced this issue Feb 10, 2021
CAMOBAP added a commit that referenced this issue Feb 10, 2021
CAMOBAP added a commit that referenced this issue Feb 10, 2021
CAMOBAP added a commit to metanorma/metanorma-itu that referenced this issue Feb 11, 2021
@CAMOBAP
Copy link
Contributor Author

CAMOBAP commented Feb 11, 2021

It works!

Several commits were pushed:

For itu new XSLT files was added, so I prepared PR for it metanorma/metanorma-itu#273

Closing this one

@CAMOBAP CAMOBAP closed this as completed Feb 11, 2021
Alexander Bobrikovich automation moved this from Medium priority to Done Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants