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

Facilitate rake update tasks #7841

Merged
merged 1 commit into from
Sep 8, 2020
Merged

Facilitate rake update tasks #7841

merged 1 commit into from
Sep 8, 2020

Conversation

dshevtsov
Copy link
Collaborator

@dshevtsov dshevtsov commented Sep 8, 2020

Purpose of this pull request

This pull request (PR) updates rake update tasks:

  • Omits pulling updates for submodules at subrepos
  • Reads directories with subrepos from Docfile instead of hardcoded
  • Instantiates content map only once and reuses it in tasks

How to test

Run rake update:subrepos (or rake update:all)

  • The result should report about all the directories listed in the Docfile
  • No failures caused by submodules at subrepos

Do not pull updates for submodules at subrepos
Read directories with subrepos from Docfile instead of hardcoded
Instantiate content map only once and reuse in tasks
@dshevtsov dshevtsov added Internal Dev Differentiates work between community and Magento staff Maintenance labels Sep 8, 2020
@dshevtsov dshevtsov self-assigned this Sep 8, 2020
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.

This works as described, however, I think we should discuss the use of submodules in general.

I'm glad that the current rake task failed and notified us that we're using a submodule in the page builder subrepo because we should not be doing that in production.

With these changes, it won't be as obvious if a submodule is introduced into a subrepo and I worry that it could potentially break something or create an unexpected user experience.

Copy link
Contributor

@bdenham bdenham left a comment

Choose a reason for hiding this comment

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

Works well.

A bit of explanation for this scenario. In my case, having the parliament submodule in the master branch is/was a test for operating parliament alongside the devdocs pipeline. And until today, that had been working fine for a couple of weeks. I setup the magento2-page-builder-docs to trigger GitHub actions that publish the parliament output to the repo's gh-pages branch. This allows me to check both outputs (devdocs vs parliament) from the same markdown files while I work on achieving parity on the parliament side.

Meanwhile, the devdocs pipeline is/was still doing its own thing, processing and publishing the same markdown files with Jekyll. This ensured I could always compare to parliament's output.

I used the docs/ directory on the master branch is my single source of truth.

In such a scenario, the two pipelines don't intersect. The docs/ directory stays pristine with markdown files only.

Hope that helps in explaining this particular scenario.

@dshevtsov
Copy link
Collaborator Author

In the page-builder case, the link to a submodule existed only at the .git directory. It was fetched, but wasn't checked out, because of sparse checkout filtering.

@dshevtsov
Copy link
Collaborator Author

The issue with Could not access submodule 'parliament' appeared last week for me. I just forgot to report about it.

@dshevtsov
Copy link
Collaborator Author

I think it's okay to allow a code repository to contain submodules, because developer teams may need to use them. Since we do not pull or checkout any content for the submodules, I don't see major risks in explicitly avoiding them. For example, if a submodule was public, then nothing would've break, and the addition of a submodule would be less noticeable.

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.

Ok, if there are no major concerns from anyone else about using submodules, then I'm good.

@bdenham, that means you can keep master as the source of truth for both scenarios you describe.

@dshevtsov
Copy link
Collaborator Author

running tests

@bdenham
Copy link
Contributor

bdenham commented Sep 8, 2020

Great. I'll keep it there since it will be a bit easier to keep doing the comparisons that way.

@dshevtsov, I'm glad to hear you got an error on it last week. That was a head scratcher. Mystery solved.

And thanks for the fix!

@dshevtsov dshevtsov merged commit cadef64 into master Sep 8, 2020
@dshevtsov dshevtsov deleted the ds_upd-rake branch September 8, 2020 17:13
@ghost
Copy link

ghost commented Sep 8, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Internal Dev Differentiates work between community and Magento staff Maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants