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

Revise checkout logic #58

Merged
merged 1 commit into from
Jun 30, 2022
Merged

Revise checkout logic #58

merged 1 commit into from
Jun 30, 2022

Conversation

nicholasray
Copy link
Contributor

@nicholasray nicholasray commented Jun 27, 2022

Revise checkout logic

Pixel is responsible for checking out the correct branch for all of its
repos, applying the correct gerrit patch, installing composer
dependencies, and running any database migrations. These need to happen
in the correct order. Before this commit, the maintenance/update.php
script was happening in the middle rather than at the very end.

This commit refactors all of the checkout logic into one class -
MwCheckout and performs the steps in the correct order.

* Replaces `checkoutBranch` and `checkoutPath` scripts with `MwCheckout`
* Adds unit tests with code coverage > 90%
* Moves all unit tests into __tests__ folder which follows the
  convention that Jest uses and that Vector uses.
* Stubs gerrit network requests in a gerritResponses.js file that are
  used by the unit tests.
* Adds an `exec` method to BatchSpawn to enable parallel processing with
  Node's `exec` command.

This ticket can be tested with the following command/gerrit patch which has
dependencies:

```
./pixel.js reference -c I8d3af86fdc3daf42441a93fc5b64ebcef37c5fb4
```

Bug: T309739

@nicholasray nicholasray marked this pull request as draft June 27, 2022 19:00
@nicholasray nicholasray force-pushed the add-mw-checkout branch 2 times, most recently from db4bd8d to c53d112 Compare June 27, 2022 20:09
@nicholasray nicholasray marked this pull request as ready for review June 27, 2022 20:11
@nicholasray nicholasray force-pushed the add-mw-checkout branch 2 times, most recently from c5732d5 to 8e440dd Compare June 30, 2022 16:06
Pixel is responsible for checking out the correct branch for all of its
repos, applying the correct gerrit patch, installing composer
dependencies, and running any database migrations. These need to happen
in the correct order. Before this commit, the maintenance/update.php
script was happening in the middle rather than at the very end.

This commit refactors all of the checkout logic into one class -
MwCheckout and performs the steps in the correct order.

* Replaces `checkoutBranch` and `checkoutPath` scripts with `MwCheckout`
* Adds unit tests with code coverage > 90%
* Moves all unit tests into __tests__ folder which follows the
  convention that Jest uses and that Vector uses.
* Stubs gerrit network requests in a gerritResponses.js file that are
  used by the unit tests.
* Adds an `exec` method to BatchSpawn to enable parallel processing with
  Node's `exec` command.

This ticket can be tested with the following command/gerrit patch which has
dependencies:

```
./pixel.js test -c I8d3af86fdc3daf42441a93fc5b64ebcef37c5fb4
```

Bug: T309739
@cjming
Copy link
Member

cjming commented Jun 30, 2022

tested locally with ./pixel.js reference -c I8d3af86fdc3daf42441a93fc5b64ebcef37c5fb4

here's what I see in git log

core:
Screen Shot 2022-06-30 at 10 55 35 AM

vector:
Screen Shot 2022-06-30 at 10 55 15 AM

The chain of dependencies look right to me🏅

@cjming cjming merged commit 8ba3d4e into main Jun 30, 2022
@nicholasray nicholasray deleted the add-mw-checkout branch June 30, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants