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

Project automation: Rewrite actions using JavaScript #17080

Merged
merged 8 commits into from
Aug 22, 2019

Conversation

noisysocks
Copy link
Member

Replaces all of our Docker container actions with a single JavaScript action.

This has a few benefits:

  • Easier to understand: Gutenberg is primarily a JavaScript application, and we're all primarily JavaScript developers, so it makes sense to use what we know.
  • More performant: According to the docs, JavaScript actions run faster than Docker container actions.
  • Testable: We can use our existing jest setup to write unit tests for our actions.
  • Less noise: By replacing 3 actions with 1 action, we'll have 1/3 as many 'checks' appear at the bottom of each PR.

Docs: https://help.github.com/en/categories/automating-your-workflow-with-github-actions

@noisysocks noisysocks added the [Type] Project Management Meta-issues related to project management of Gutenberg label Aug 19, 2019
@noisysocks noisysocks changed the title GitHub Actions: Rewrite actions using JavaScript Project automation: Rewrite actions using JavaScript Aug 19, 2019
@noisysocks noisysocks force-pushed the update/use-javascript-actions branch from 21cbdad to d4ca647 Compare August 19, 2019 05:30
@noisysocks
Copy link
Member Author

Yay, it works!

I'm pretty happy with where this is at, although I'd like to remove the npm install and npm run build:packages steps since they're so slow.

What do you think, @talldan?

@@ -64,6 +64,8 @@
"@wordpress/wordcount": "file:packages/wordcount"
},
"devDependencies": {
"@actions/core": "1.0.0",
"@actions/github": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I wouldn't have thought these dependencies were needed in the root package.json.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the pointer @swissspidy.

Copy link
Member

Choose a reason for hiding this comment

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

But these are also listed as dependencies in packages/project-management-automation/package.json . Surely they don't need to be declared twice? They seem more appropriate as dependencies to me than as devDependencies, since they're required for the runtime script of the module.

Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Love this, introduces a really nice scaffolding to add more automation to PRs, and ensures there won't be any extra noise if we do. ❤️

I'd be happy to see it merged and have smaller follow up PRs address the comments.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Nice work here 🎉

@noisysocks noisysocks force-pushed the update/use-javascript-actions branch from c2ed9f9 to 3c22f92 Compare August 22, 2019 02:23
@noisysocks
Copy link
Member Author

noisysocks commented Aug 22, 2019

@talldan @youknowriad: Pretty happy with this now! Have moved a few things around so will need another review.

  • I renamed the package from pull-request-automation to project-management-automation in anticipation of future tasks that might do more than just manage pull requests.
  • I'm running npm install inside the action's directory which makes the action run a lot faster.
  • I removed Babel transpilation from the package which makes the action run a lot faster.
  • I added lots of logging which should help us work out out what's going wrong/on.
  • I refactored the code that invokes our different tasks so that it's easier to add new ones.
  • I fixed a mistake where I was looking at context.action instead of context.payload.action 🙄

Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Double approving!

@noisysocks noisysocks merged commit 47dfd82 into master Aug 22, 2019
@noisysocks noisysocks deleted the update/use-javascript-actions branch August 22, 2019 05:02
donmhico pushed a commit to donmhico/gutenberg that referenced this pull request Aug 27, 2019
* Project automation: Rewrite actions using JavaScript

* Project automation: Don't transpile or install all dependencies

* Project automation: pull-request-automation -> project-management-automation

* Project automation: Add explanatory comment for `npm install` hack

* Project automation: Add debug statements

* Project automation: Don't use GitHub's debug() function

* Project automation: Use `payload` in tasks, not `context`

* Project automation: Link to the relevant GitHub documentation
gziolo pushed a commit that referenced this pull request Aug 29, 2019
* Project automation: Rewrite actions using JavaScript

* Project automation: Don't transpile or install all dependencies

* Project automation: pull-request-automation -> project-management-automation

* Project automation: Add explanatory comment for `npm install` hack

* Project automation: Add debug statements

* Project automation: Don't use GitHub's debug() function

* Project automation: Use `payload` in tasks, not `context`

* Project automation: Link to the relevant GitHub documentation
gziolo pushed a commit that referenced this pull request Aug 29, 2019
* Project automation: Rewrite actions using JavaScript

* Project automation: Don't transpile or install all dependencies

* Project automation: pull-request-automation -> project-management-automation

* Project automation: Add explanatory comment for `npm install` hack

* Project automation: Add debug statements

* Project automation: Don't use GitHub's debug() function

* Project automation: Use `payload` in tasks, not `context`

* Project automation: Link to the relevant GitHub documentation
daniloercoli added a commit that referenced this pull request Sep 4, 2019
 into rnmobile/add-autosave-to-mobile

* 'rnmobile/master' of https://github.com/WordPress/gutenberg: (52 commits)
  [RNMobile] DarkMode improvements (#17309)
  Remove redundant bg color within button appender (#17325)
  Support group block on mobile (#17251)
  [RNMobile] Insure tapping at end of post inserts at end
  Recover border colors (#17269)
  [RNMobile] Fix dismiss keyboard button for the post title (#17260)
  Unify media placeholder and upload props within media-text (#17268)
  MediaUpload and MediaPlaceholder unify props (#17145)
  Add native support for the MediaText block (#16305)
  Activate Travis CI on rnmobile/master branch (#17229)
  [RNMobile] Native mobile release v1.11.0 (#17181)
  Apply box-sizing border-box properly to the notices components (#17066)
  Writing Flow: allow undo of patterns with BACKSPACE and ESC (#14776)
  Project automation: Rewrite actions using JavaScript (#17080)
  Build: remove global install of latest npm since we want to use the paired node/npm version (#17134)
  Writing Flow/Quote: allow splitting (#17121)
  Use `400` as a valid `font-weight`
  Add: Disabled block count in the block manager (#17103)
  Update video player style on mobile - Add a new gridicon play icon, from: https://github.com/Automattic/gridicons/blob/87c9fce08b4a9f184b9fb4963228757fdd4f4e74/svg-min/gridicons-play.svg - Replace the Dashicon play by this one - Update icon size and icon color - Update the overlay color
  [RNMobile] Hide replaceable block when adding block (#16931)
  ...

# Conflicts:
#	packages/block-editor/src/components/block-list/index.native.js
#	packages/block-editor/src/components/inserter/index.native.js
#	packages/block-editor/src/components/inserter/menu.native.js
#	packages/block-editor/src/components/media-placeholder/index.native.js
#	packages/block-editor/src/components/warning/index.native.js
#	packages/block-library/src/code/edit.native.js
#	packages/block-library/src/image/edit.native.js
#	packages/block-library/src/missing/edit.native.js
#	packages/block-library/src/more/edit.native.js
#	packages/block-library/src/nextpage/edit.native.js
#	packages/block-library/src/video/edit.native.js
#	packages/components/src/mobile/bottom-sheet/cell.native.js
#	packages/components/src/mobile/bottom-sheet/index.native.js
#	packages/components/src/mobile/dark-mode/index.native.js
#	packages/components/src/mobile/html-text-input/index.native.js
#	packages/components/src/toolbar/toolbar-container.native.js
#	packages/edit-post/src/components/header/header-toolbar/index.native.js
#	packages/edit-post/src/components/layout/index.native.js
#	packages/edit-post/src/components/visual-editor/index.native.js
#	packages/rich-text/src/component/index.native.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Project Management Meta-issues related to project management of Gutenberg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants