Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

[site] Add 'rake index' and 'rake multirepo:reinit' #6008

Merged
merged 8 commits into from
Nov 15, 2019
Merged

Conversation

dshevtsov
Copy link
Collaborator

@dshevtsov dshevtsov commented Nov 15, 2019

Purpose of this pull request

This pull request:

  1. Adds rake index that runs Algolia indexing (internal use only)
  2. Adds rake multirepo:reindex that removes existing sources listed in Docfile.yml and runs rake init to recreate the file tree
  3. Adds exception handling to the rake multirepo: tasks when a subrepository failed to checkout

Use ruby syntax for environment variable
Exit if rake init fails on checkout
Remove --dry-run
Add output message
Replaced 'print + exit' with equal 'abort'
Add rake reinit
Refactor
@dshevtsov dshevtsov added the Site Improvements Updates to tools, processes, and site architecture that improve reader and contributor experience label Nov 15, 2019
@dshevtsov dshevtsov self-assigned this Nov 15, 2019
Copy link
Contributor

@jeff-matthews jeff-matthews left a comment

Choose a reason for hiding this comment

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

Seems to work as expected. The only thing that's peculiar is that the reinit task is namespaced to multirepo just like init, but there's no option to run rake reinit like there is for rake init. It's not a big deal, I'm just curious why it's set up this way.

$ rake -T
...
rake index                # Generate index for Algolia
rake init                 # Pull docs from external repositories
rake multirepo:add        # Add multirepo docs providing shell arguments "dir=<directory where to init a repo>", "repo=<SSH URL>", "branch=<branch to checkout>", "filter=<true/false>" ("true" by default)...
rake multirepo:init       # Create a file tree for devdocs website and get all required content
rake multirepo:reinit     # Reinitialize subrepositories
...

@dshevtsov
Copy link
Collaborator Author

dshevtsov commented Nov 15, 2019

why it's set up this way

It's done on purpose to decrease risk of mixing up rake init with rake reinit. The command is destructive and can make undesirable changes when run by mistake by a person who contributes to a subrepository.

@jeff-matthews
Copy link
Contributor

Thanks for explaining!

@dshevtsov
Copy link
Collaborator Author

running tests

@dshevtsov dshevtsov merged commit 3f42290 into master Nov 15, 2019
@ghost
Copy link

ghost commented Nov 15, 2019

Hi @dshevtsov, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@dshevtsov dshevtsov deleted the ds_rake-index branch November 15, 2019 18:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Site Improvements Updates to tools, processes, and site architecture that improve reader and contributor experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants