Skip to content

Conversation

@andrewnicols
Copy link
Member

This commit makes use of the nodemw package
(https://github.com/macbre/nodemw) to interact with the Wikimedia API
and:

  • fetch a list of all pages with the {{Template:obsolete}} template
    transcluded, updating the list of obsolete pages to warn about
  • ensure that all migrated pages are correctly identified in the
    Developer Docs.

To achieve this:

  • the migratedPages.js is broken out such that migrated page data is
    now read from a data/migratedPages.json file, and obsolete page data
    from a data/obsoletePages.json file.
  • the migrated page JSON is modified to include both the slug, and the
    markdown path. This is to work around the difficulties of determining
    the final route on a Docusaurus page and may be fixed in future when I
    have time to work this out

This workflow is called automatically on any push to the main branch,
or on request via the Github Actions UI.

It will use a set of repository secrets for WIKIMEDIA_USER and
WIKIMEDIA_PASSWORD.

@andrewnicols andrewnicols self-assigned this Apr 20, 2022
@andrewnicols andrewnicols added migration Migration of a document from the legacy site repo tooling labels Apr 20, 2022
@andrewnicols andrewnicols added this to the Migration day milestone Apr 20, 2022
@andrewnicols andrewnicols force-pushed the migratePagesAction branch 2 times, most recently from 949eb69 to dfcfbf6 Compare April 20, 2022 12:40
@andrewnicols
Copy link
Member Author

Rebased on files changes.

This commit makes use of the `nodemw` package
(https://github.com/macbre/nodemw) to interact with the Wikimedia API
and:

- fetch a list of all pages with the `{{Template:obsolete}}` template
  transcluded, updating the list of obsolete pages to warn about
- ensure that all migrated pages are correctly identified in the
  Developer Docs.

To achieve this:

- the `migratedPages.js` is broken out such that migrated page data is
  now read from a `data/migratedPages.yml` file, and obsolete page data
  from a `data/obsoletePages.json` file.
- the migrated page YML is modified to include both the slug, and the
  markdown path. This is to work around the difficulties of determining
  the final route on a Docusaurus page and may be fixed in future when I
  have time to work this out

This workflow is called automatically on any push to the `main` branch,
or on request via the Github Actions UI.

It will use a set of repository secrets for `WIKIMEDIA_USER` and
`WIKIMEDIA_PASSWORD`.
Copy link
Member

@sarjona sarjona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great idea and a very good implementation, Andrew! The patch is working as expected (I've been able to execute it locally and pages for File_API and File_API_internal have been updated properly). Well done! :-)
Apart from that, I've also been able to confirm the obsoletePages.json is updated as expected.

That's a good automatisation that will help us to migrate pages. And in the near future, once the new devdocs will be ready for that, will be great to use this script to protect the migrated pages too!

@sarjona sarjona merged commit 899372a into moodle:main Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration Migration of a document from the legacy site repo tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants