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

ci: refactor github workflows #213

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

johnhooks
Copy link
Collaborator

@johnhooks johnhooks commented Apr 2, 2023

What?

Refactor the GitHub CI workflows.

Abstract out Node.js and PHP environment setup into actions.

Why?

The current CI workflows do not properly setup the PHP environment for JS e2e testing, if the project implements PSR-4 autoloading. Composer needs to run to generate the autoloading files.

Prepares for #201.

This PR also adds NPM caching to all the matrix environments.

How?

This PR does the following:

  • Extracts the Node.js and PHP environment configurations into custom actions, .github/actions/node and .github/actions/php respectively. Reduces duplicate code when setting up multiple workflows needing the same steps.
  • Set up caching of Node.js dependencies, which should speed up CI workflows as long as the package-lock.json doesn't change. It works exactly the same to the previous caching of composer dependencies.
  • Uses the new environment setup actions to set up three new workflows:
    • node-build.yml - Check that the Node.js portion of the project builds without error.
    • test-suite.yml - Check that the Node.js and PHP tests pass.
    • coding-standards.yml - Check coding standards of JavaScript and PHP files.

@johnhooks johnhooks requested a review from erikyo April 2, 2023 16:43
@johnhooks johnhooks added the [Type] development tools Setting up and cofniguring tools to help with the development process. label Apr 2, 2023
Copy link
Collaborator

@erikyo erikyo left a comment

Choose a reason for hiding this comment

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

LGTM

erikyo
erikyo previously approved these changes Apr 2, 2023
@johnhooks johnhooks added the [Status] Blocked When another issue need to be taken care of first. label Apr 2, 2023
@johnhooks johnhooks added [Type] Project Management Meta-issues related to WP Notify project management. and removed [Type] development tools Setting up and cofniguring tools to help with the development process. [Type] Project Management Meta-issues related to WP Notify project management. labels Apr 2, 2023
@erikyo erikyo requested a review from Sephsekla April 3, 2023 09:09
@Sephsekla Sephsekla added [Type] development tools Setting up and cofniguring tools to help with the development process. and removed [Status] Blocked When another issue need to be taken care of first. labels Apr 3, 2023
@Sephsekla
Copy link
Collaborator

Hmmm, it seems like there's still a problem with eslint - I don't know if something's up with .eslintrc or caching as a result of this change, but it doesn't look like it's following the WP Coding Standards.

@johnhooks I'll have a more in-depth review of this when I have a sec, but do you mind outlining exactly what we should end up with in terms of actions and workflows in the PR description? I'd like to include it in a CONTRIBUTING.md file, and it will also need to be changed in the branch protection rules.

@johnhooks
Copy link
Collaborator Author

@Sephsekla those errors are all the ones you just approved fixing in the previous PR #212 by @erikyo. I'll rebase and they should be gone.

@Sephsekla
Copy link
Collaborator

@Sephsekla those errors are all the ones you just approved fixing in the previous PR #212 by @erikyo. I'll rebase and they should be gone.

Hmm, this should have been up to date with release at that point, and looks like it's still failing with your latest push 🤔

@johnhooks
Copy link
Collaborator Author

@Sephsekla I'm still looking into it. How does the reworked PR description look?

@Sephsekla
Copy link
Collaborator

Awesome! Thanks for this, I'd been meaning to look at something like this with modularising the actions for ages.

@johnhooks
Copy link
Collaborator Author

johnhooks commented Apr 3, 2023

@Sephsekla and @erikyo the coding standard is failing because of the JavaScript files. Please look at the list of errors in the CI log and see how you would like to fix them. This isn't an error with this workflow, but the code currently committed to the repo, or the eslint configuration.

@johnhooks
Copy link
Collaborator Author

Running npm run lint:js on my machine results in the following, which looks like it matches CI.

ESLint output
➜  wp-feature-notifications git:(ci/refactor-workflows) ✗ npm run lint:js

> @wordpress/[email protected] lint:js
> wp-scripts lint-js ./src


/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/Notice.js
  19:28  error  Replace `·{·date,·source·}·` with `{·date,·source·}`                                                                                                       prettier/prettier
  21:27  error  Replace `·source·}</span>·{·'\u2022·'·` with `source}</span>·{'\u2022·'`                                                                                   prettier/prettier
  22:27  error  Replace `·moment(·date·).fromNow()·` with `moment(date).fromNow()`                                                                                         prettier/prettier
  32:24  error  Replace `·props·` with `props`                                                                                                                             prettier/prettier
  39:13  error  Replace `·'Just·now'·` with `'Just·now'`                                                                                                                   prettier/prettier
  50:12  error  Replace `·NOTIFY_NAMESPACE·).updateNotice(·` with `NOTIFY_NAMESPACE).updateNotice(`                                                                        prettier/prettier
  53:4   error  Delete `·`                                                                                                                                                 prettier/prettier
  54:12  error  Replace `·NOTIFY_NAMESPACE·).removeNotice(·id·` with `NOTIFY_NAMESPACE).removeNotice(id`                                                                   prettier/prettier
  59:15  error  Delete `·`                                                                                                                                                 prettier/prettier
  66:5   error  Delete `·`                                                                                                                                                 prettier/prettier
  69:44  error  Replace `·title·` with `title`                                                                                                                             prettier/prettier
  70:6   error  Replace `·message·??·(⏎↹↹↹↹↹<p·dangerouslySetInnerHTML={·purify(·message·)·}·/>⏎↹↹↹↹)·` with `message·??·<p·dangerouslySetInnerHTML={purify(message)}·/>`  prettier/prettier
  74:14  error  Replace `·props?.action·??·{}·` with `props?.action·??·{}`                                                                                                 prettier/prettier
  75:17  error  Replace `·dismissNotice·` with `dismissNotice`                                                                                                             prettier/prettier
  76:15  error  Replace `·context·` with `context`                                                                                                                         prettier/prettier
  77:19  error  Replace `·dismissible·` with `dismissible`                                                                                                                 prettier/prettier
  79:23  error  Replace `·date·}·source={·source·` with `date}·source={source`                                                                                             prettier/prettier
  82:17  error  Replace `·...props·` with `...props`                                                                                                                       prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/NoticeAction.js
  15:24  error  Replace `·{⏎↹action,⏎↹context,⏎↹dismissible·=·false,⏎↹onDismiss,⏎}·` with `{·action,·context,·dismissible·=·false,·onDismiss·}`  prettier/prettier
  23:22  error  Replace `·'Accept'·` with `'Accept'`                                                                                             prettier/prettier
  24:21  error  Replace `·'Dismiss'·` with `'Dismiss'`                                                                                           prettier/prettier
  27:6   error  Replace `·context·===·defaultContext·` with `context·===·defaultContext`                                                         prettier/prettier
  30:14  error  Replace `·'link'·` with `'link'`                                                                                                 prettier/prettier
  32:14  error  Replace `·()·=>·(·window.location.href·=·acceptLink·)·` with `()·=>·(window.location.href·=·acceptLink)`                         prettier/prettier
  33:16  error  Replace `·'wp-notification-action'·` with `'wp-notification-action'`                                                             prettier/prettier
  35:6   error  Replace `·acceptMessage·` with `acceptMessage`                                                                                   prettier/prettier
  43:14  error  Replace `·'primary'·` with `'primary'`                                                                                           prettier/prettier
  44:16  error  Replace `·'button-primary·wp-notification-action'·` with `'button-primary·wp-notification-action'`                               prettier/prettier
  45:14  error  Replace `·()·=>·(·window.location.href·=·acceptLink·)·` with `()·=>·(window.location.href·=·acceptLink)`                         prettier/prettier
  47:6   error  Replace `·acceptMessage·` with `acceptMessage`                                                                                   prettier/prettier
  49:5   error  Delete `·`                                                                                                                       prettier/prettier
  51:15  error  Replace `·'tertiary'·` with `'tertiary'`                                                                                         prettier/prettier
  52:17  error  Replace `·'button-tertiary·wp-notification-action'·` with `'button-tertiary·wp-notification-action'`                             prettier/prettier
  53:15  error  Replace `·()·=>·onDismiss()·` with `()·=>·onDismiss()`                                                                           prettier/prettier
  54:12  error  Replace `·'no-alt'·` with `'no-alt'`                                                                                             prettier/prettier
  56:7   error  Replace `·dismissLabel·` with `dismissLabel`                                                                                     prettier/prettier
  58:5   error  Delete `·`                                                                                                                       prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/NoticeEmpty.js
  3:29  error  Replace `·props·` with `props`                                                                        prettier/prettier
  5:15  error  Replace `·{·padding:·'20px',·textAlign:·'center'·}·` with `{·padding:·'20px',·textAlign:·'center'·}`  prettier/prettier
  6:16  error  Replace `·comment·}·size={·props.size·` with `comment}·size={props.size`                              prettier/prettier
  7:8   error  Replace `·props.message·` with `props.message`                                                        prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/NoticeHubFooter.js
  15:10  error  Replace `·settingsPageUrl·` with `settingsPageUrl`                                                prettier/prettier
  17:10  error  Replace `·cog·` with `cog`                                                                        prettier/prettier
  18:10  error  Replace `·__(·'Configure·notification·settings'·)·` with `__('Configure·notification·settings')`  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/NoticeHubSectionHeader.js
  15:40  error  Replace `·{·isMain,·unreadCount,·context·}·` with `{·isMain,·unreadCount,·context·}`    prettier/prettier
  18:9   error  Replace `·unreadCount·` with `unreadCount`                                              prettier/prettier
  22:14  error  Replace `·()·=>·clearNotifyDrawer(·context·)·` with `()·=>·clearNotifyDrawer(context)`  prettier/prettier
  23:11  error  Replace `·check·` with `check`                                                          prettier/prettier
  24:14  error  Replace `·true·` with `true`                                                            prettier/prettier
  25:11  error  Replace `·__(·'Mark·all·as·read'·)·` with `__('Mark·all·as·read')`                      prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/NoticeImage.js
  16:28  error  Replace `·{·icon,·severity,·context·=·defaultContext·}·` with `{·icon,·severity,·context·=·defaultContext·}`  prettier/prettier
  20:4   error  Delete `·`                                                                                                    prettier/prettier
  21:25  error  Replace `·context·||·'adminbar'·` with `context·||·'adminbar'`                                                prettier/prettier
  27:6   error  Replace `·icon?.svg·` with `icon?.svg`                                                                        prettier/prettier
  31:16  error  Replace `·classes·` with `classes`                                                                            prettier/prettier
  32:30  error  Replace `·purify(·icon?.svg·)·` with `purify(icon?.svg)`                                                      prettier/prettier
  35:13  error  Replace `·icon?.dashicons·` with `icon?.dashicons`                                                            prettier/prettier
  38:16  error  Delete `·`                                                                                                    prettier/prettier
  39:7   error  Delete `·`                                                                                                    prettier/prettier
  42:6   error  Delete `·`                                                                                                    prettier/prettier
  48:15  error  Replace `·icon?.src·||·wpLogo·}·alt={·''·` with `icon?.src·||·wpLogo}·alt={''`                                prettier/prettier
  54:25  error  Replace `·classes·}>{·image·` with `classes}>{image`                                                          prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/NoticesArea.js
  20:29  error  Replace `·props·` with `props`                                                                                                        prettier/prettier
  27:4   error  Replace `·select·)·=>·select(·NOTIFY_NAMESPACE·).getNotices(·context·` with `select)·=>·select(NOTIFY_NAMESPACE).getNotices(context`  prettier/prettier
  34:6   error  Replace `·context·===·defaultContext·` with `context·===·defaultContext`                                                              prettier/prettier
  36:7   error  Replace `·!·notifications.length·` with `!notifications.length`                                                                       prettier/prettier
  37:30  error  Replace `·96·}·message={·__(·'empty'·)·` with `96}·message={__('empty')`                                                              prettier/prettier
  41:28  error  Replace `·notifications,·splitBy·` with `notifications,·splitBy`                                                                      prettier/prettier
  45:6   error  Replace `·sorted.map(·(·list,·index·` with `sorted.map((list,·index`                                                                  prettier/prettier
  46:20  error  Replace `·index·` with `index`                                                                                                        prettier/prettier
  48:17  error  Replace `·context·` with `context`                                                                                                    prettier/prettier
  49:21  error  Replace `·list.length·` with `list.length`                                                                                            prettier/prettier
  50:16  error  Replace `·index·===·0·` with `index·===·0`                                                                                            prettier/prettier
  52:29  error  Replace `·list·` with `list`                                                                                                          prettier/prettier
  54:6   error  Replace `·)·` with `)`                                                                                                                prettier/prettier
  63:31  error  Replace `·notifications·` with `notifications`                                                                                        prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/components/NoticesLoop.js
  12:29  error  Replace `·{·notices·}·` with `{·notices·}`                                                                                            prettier/prettier
  13:14  error  Replace `·(·notify,·index·)·=>·<Notice·{·...notify·}·key={·index·}·/>·` with `(notify,·index)·=>·<Notice·{...notify}·key={index}·/>`  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/actions.js
   1:25  error  Replace `·payload·` with `payload`      prettier/prettier
   8:23  error  Replace `·context·` with `context`      prettier/prettier
  15:27  error  Replace `·payload·` with `payload`      prettier/prettier
  22:30  error  Replace `·id·` with `id`                prettier/prettier
  29:30  error  Replace `·payload·` with `payload`      prettier/prettier
  36:26  error  Replace `·path·=·''·` with `path·=·''`  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/constants.js
  20:26  error  Replace `·defaultContext,·'dashboard'·` with `defaultContext,·'dashboard'`  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/controls.js
  10:23  error  Replace `·action·` with `action`  prettier/prettier
  11:18  error  Delete `·`                        prettier/prettier
  13:3   error  Delete `·`                        prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/index.js
  15:32  error  Delete `·`                      prettier/prettier
  21:2   error  Delete `·`                      prettier/prettier
  23:10  error  Replace `·store·` with `store`  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/reducer.js
  12:18  error  Replace `·state·=·{},·action·` with `state·=·{},·action`                                                          prettier/prettier
  13:10  error  Replace `·action.type·` with `action.type`                                                                        prettier/prettier
  16:27  error  Replace `·(·notification·` with `(notification`                                                                   prettier/prettier
  20:7   error  Replace `·context·]:·[·...updated[·context·],·notification·` with `context]:·[...updated[context],·notification`  prettier/prettier
  22:5   error  Delete `·`                                                                                                        prettier/prettier
  28:6   error  Replace `·action.payload.context·` with `action.payload.context`                                                  prettier/prettier
  29:15  error  Replace `·action.payload.context·` with `action.payload.context`                                                  prettier/prettier
  35:32  error  Replace `·state,·action.id·` with `state,·action.id`                                                              prettier/prettier
  38:6   error  Replace `·context·]:·state[·context·` with `context]:·state[context`                                              prettier/prettier
  39:7   error  Replace `·notice·` with `notice`                                                                                  prettier/prettier
  44:10  error  Replace `·action.context·` with `action.context`                                                                  prettier/prettier
  48:33  error  Replace `·state,·action.payload.id·` with `state,·action.payload.id`                                              prettier/prettier
  49:10  error  Replace `·location·].map(·(·notice·` with `location].map((notice`                                                 prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/resolvers.js
   9:6   error  Replace `·newNotifications·` with `newNotifications`  prettier/prettier
  10:18  error  Replace `·newNotifications·` with `newNotifications`  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/selectors.js
  10:30  error  Replace `·state·` with `state`                                                                                                prettier/prettier
  20:28  error  Replace `·state,·context·` with `state,·context`                                                                              prettier/prettier
  21:25  error  Replace `·context·` with `context`                                                                                            prettier/prettier
  31:33  error  Replace `·state,·context·` with `state,·context`                                                                              prettier/prettier
  32:6   error  Replace `·!·state[·context·]·` with `!state[context]`                                                                         prettier/prettier
  33:9   error  Replace `·context·` with `context`                                                                                            prettier/prettier
  47:28  error  Replace `·state,·searchTerm,·args·=·{·term:·'source'·}·` with `state,·searchTerm,·args·=·{·term:·'source'·}`                  prettier/prettier
  49:6   error  Replace `·typeof·searchTerm·===·'number'·` with `typeof·searchTerm·===·'number'`                                              prettier/prettier
  50:31  error  Replace `·state,·searchTerm·` with `state,·searchTerm`                                                                        prettier/prettier
  51:16  error  Replace `·context·].find(·(·notice·)·=>·notice.id·===·searchTerm·` with `context].find((notice)·=>·notice.id·===·searchTerm`  prettier/prettier
  55:6   error  Replace `·typeof·searchTerm·===·'string'·` with `typeof·searchTerm·===·'string'`                                              prettier/prettier
  59:31  error  Replace `·state·` with `state`                                                                                                prettier/prettier
  62:6   error  Replace `·el·` with `el`                                                                                                      prettier/prettier
  63:9   error  Replace `·searchFor·` with `searchFor`                                                                                        prettier/prettier
  64:9   error  Replace `·searchFor·].toLowerCase().includes(·searchTerm·` with `searchFor].toLowerCase().includes(searchTerm`                prettier/prettier
  67:7   error  Replace `·found.length·` with `found.length`                                                                                  prettier/prettier
  71:12  error  Replace `·'nothing·was·found'·` with `'nothing·was·found'`                                                                    prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/store/utils.js
   7:29  error  Replace `·notifications,·id·` with `notifications,·id`                              prettier/prettier
   8:7   error  Replace `·const·location·in·notifications·` with `const·location·in·notifications`  prettier/prettier
   9:31  error  Replace `·location·` with `location`                                                prettier/prettier
  10:5   error  Replace `·notification·` with `notification`                                        prettier/prettier
  12:7   error  Replace `·found·` with `found`                                                      prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/utils/drawer.js
  10:35  error  Replace `·context·` with `context`                                                                                                      prettier/prettier
  11:11  error  Replace `·NOTIFY_NAMESPACE·).clear(·context·` with `NOTIFY_NAMESPACE).clear(context`                                                    prettier/prettier
  22:27  error  Replace `·notifications,·by·=·'date'·` with `notifications,·by·=·'date'`                                                                prettier/prettier
  24:6   error  Replace `·Limit·` with `Limit`                                                                                                          prettier/prettier
  26:5   error  Replace `·[·current,·past·],·item·` with `[current,·past],·item`                                                                        prettier/prettier
  28:9   error  Replace `·[·...current,·item·],·past·` with `[...current,·item],·past`                                                                  prettier/prettier
  29:9   error  Replace `·current,·[·...past,·item·]·` with `current,·[...past,·item]`                                                                  prettier/prettier
  31:5   error  Replace `·[],·[]·` with `[],·[]`                                                                                                        prettier/prettier
  37:52  error  Replace `·'wp-admin-bar-wp-notify'·` with `'wp-admin-bar-wp-notify'`                                                                    prettier/prettier
  45:37  error  Replace `·e·` with `e`                                                                                                                  prettier/prettier
  47:31  error  Replace `·'active'·` with `'active'`                                                                                                    prettier/prettier
  49:36  error  Replace `·'click',·disableNotifyDrawer·` with `'click',·disableNotifyDrawer`                                                            prettier/prettier
  60:36  error  Replace `·e·` with `e`                                                                                                                  prettier/prettier
  62:6   error  Replace `·!·wpNotifyHub.classList.contains(·'active'·)·` with `!wpNotifyHub.classList.contains('active')`                               prettier/prettier
  63:29  error  Replace `·'active'·` with `'active'`                                                                                                    prettier/prettier
  64:34  error  Replace `·'click',·disableNotifyDrawer·` with `'click',·disableNotifyDrawer`                                                            prettier/prettier
  65:25  error  Replace `·ev·` with `ev`                                                                                                                prettier/prettier
  66:8   error  Replace `·'key'·in·ev·&&·(·ev.key·===·'Escape'·||·ev.key·===·'Esc'·)·` with `'key'·in·ev·&&·(ev.key·===·'Escape'·||·ev.key·===·'Esc')`  prettier/prettier
  76:5   error  Replace `·wpNotifyHub·` with `wpNotifyHub`                                                                                              prettier/prettier
  85:31  error  Replace `·'click',·enableNotifyDrawer·` with `'click',·enableNotifyDrawer`                                                              prettier/prettier
  86:31  error  Replace `·'focus',·enableNotifyDrawer,·true·` with `'focus',·enableNotifyDrawer,·true`                                                  prettier/prettier
  87:31  error  Replace `·'blur',·disableNotifyDrawer,·true·` with `'blur',·disableNotifyDrawer,·true`                                                  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/utils/effects.js
  8:23  error  Replace `·ms·)·=>·new·Promise(·(·f·)·=>·setTimeout(·f,·ms·)·` with `ms)·=>·new·Promise((f)·=>·setTimeout(f,·ms)`  prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/utils/metaBox.js
   7:25  error  Delete `·`                                                                     prettier/prettier
  15:6   error  Replace `·wpNotificationMetabox·` with `wpNotificationMetabox`                 prettier/prettier
  16:42  error  Replace `·'submit',·(·e·` with `'submit',·(e`                                  prettier/prettier
  25:13  error  Replace `·NOTIFY_NAMESPACE·).addNotice(·` with `NOTIFY_NAMESPACE).addNotice(`  prettier/prettier
  29:5   error  Delete `·`                                                                     prettier/prettier
  30:4   error  Delete `·`                                                                     prettier/prettier
  39:6   error  Replace `·wpNotificationClearAll·` with `wpNotificationClearAll`               prettier/prettier
  40:43  error  Delete `·`                                                                     prettier/prettier
  41:20  error  Replace `·'dashboard'·` with `'dashboard'`                                     prettier/prettier
  42:4   error  Delete `·`                                                                     prettier/prettier
  43:2   error  Delete `·`                                                                     prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/utils/sanitization.js
   9:24  error  Replace `·string,·options·=·{}·` with `string,·options·=·{}`  prettier/prettier
  11:30  error  Replace `·string,·options·` with `string,·options`            prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/scripts/wp-notify.js
   25:29  error  Replace `·NOTIFY_NAMESPACE·` with `NOTIFY_NAMESPACE`                                                                                                          prettier/prettier
   32:8   error  Replace `·context·=·''·)·=>·select(·NOTIFY_NAMESPACE·).getNotices(·context·` with `context·=·'')·=>·select(NOTIFY_NAMESPACE).getNotices(context`              prettier/prettier
   46:9   error  Replace `·term,·args·)·=>·select(·NOTIFY_NAMESPACE·).findNotice(·term,·args·` with `term,·args)·=>·select(NOTIFY_NAMESPACE).findNotice(term,·args`            prettier/prettier
   53:8   error  Replace `·payload·)·=>·dispatch(·NOTIFY_NAMESPACE·).addNotice(·payload·` with `payload)·=>·dispatch(NOTIFY_NAMESPACE).addNotice(payload`                      prettier/prettier
   60:11  error  Replace `·id·)·=>·dispatch(·NOTIFY_NAMESPACE·).removeNotice(·id·` with `id)·=>·dispatch(NOTIFY_NAMESPACE).removeNotice(id`                                    prettier/prettier
   67:10  error  Replace `·context·=·'adminbar'·)·=>⏎↹↹dispatch(·NOTIFY_NAMESPACE·).clear(·context·` with `context·=·'adminbar')·=>·dispatch(NOTIFY_NAMESPACE).clear(context`  prettier/prettier
   79:18  error  Replace `·(·context·` with `(context`                                                                                                                         prettier/prettier
   80:9   error  Replace `·NOTIFY_NAMESPACE·).registerContext(·context·` with `NOTIFY_NAMESPACE).registerContext(context`                                                      prettier/prettier
   84:8   error  Replace `·NOTIFY_NAMESPACE·` with `NOTIFY_NAMESPACE`                                                                                                          prettier/prettier
   89:18  error  Replace `·(·context·` with `(context`                                                                                                                         prettier/prettier
   96:17  error  Delete `·`                                                                                                                                                    prettier/prettier
   99:4   error  Delete `·`                                                                                                                                                    prettier/prettier
  100:27  error  Replace `·`wp-notify-${·context·}`·` with ``wp-notify-${context}``                                                                                            prettier/prettier
  102:2   error  Delete `·`                                                                                                                                                    prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/stories/Dash-multiple.stories.js
  24:3   error  Replace `·term·)·=>·term.hasOwnProperty(·'context'·` with `term)·=>·term.hasOwnProperty('context'`              prettier/prettier
  33:13  error  Replace `·{·name:·'WordPress',·value:·'#f0f0f1'·}·` with `{·name:·'WordPress',·value:·'#f0f0f1'·}`              prettier/prettier
  45:40  error  Replace `·args·` with `args`                                                                                    prettier/prettier
  49:11  error  Delete `·`                                                                                                      prettier/prettier
  52:5   error  Delete `·`                                                                                                      prettier/prettier
  54:5   error  Replace `·getSorted(·adminBarNotices·).map(·(·list,·index·` with `getSorted(adminBarNotices).map((list,·index`  prettier/prettier
  56:11  error  Replace `·index·` with `index`                                                                                  prettier/prettier
  57:15  error  Replace `·list·` with `list`                                                                                    prettier/prettier
  58:14  error  Replace `·undefined·` with `undefined`                                                                          prettier/prettier
  59:15  error  Replace `·'dashboard'·` with `'dashboard'`                                                                      prettier/prettier
  60:7   error  Replace `·...args·` with `...args`                                                                              prettier/prettier
  62:5   error  Replace `·)·` with `)`                                                                                          prettier/prettier
  68:60  error  Replace `·{}·` with `{}`                                                                                        prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/stories/Dash-single.stories.js
  26:13  error  Replace `·{·name:·'WordPress',·value:·'#f0f0f1'·}·` with `{·name:·'WordPress',·value:·'#f0f0f1'·}`  prettier/prettier
  58:19  error  Replace `·args·` with `args`                                                                        prettier/prettier
  61:10  error  Delete `·`                                                                                          prettier/prettier
  64:4   error  Delete `·`                                                                                          prettier/prettier
  67:13  error  Replace `·...args·}·context={·'dashboard'·` with `...args}·context={'dashboard'`                    prettier/prettier
  72:37  error  Replace `·{}·` with `{}`                                                                            prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/stories/Hub-multiple.stories.js
   30:3   error  Replace `·term·)·=>⏎↹↹!·term.hasOwnProperty(·'context'·` with `term)·=>·!term.hasOwnProperty('context'`                                                                           prettier/prettier
   40:13  error  Replace `·{·name:·'WordPress',·value:·'#f0f0f1'·}·` with `{·name:·'WordPress',·value:·'#f0f0f1'·}`                                                                                prettier/prettier
   45:14  error  Replace `·'title',·'date',·'id'·` with `'title',·'date',·'id'`                                                                                                                    prettier/prettier
   56:19  error  Replace `·args·` with `args`                                                                                                                                                      prettier/prettier
   57:27  error  Replace `·null·` with `null`                                                                                                                                                      prettier/prettier
   63:24  error  Replace `·e·` with `e`                                                                                                                                                            prettier/prettier
   65:33  error  Replace `·'active'·` with `'active'`                                                                                                                                              prettier/prettier
   73:25  error  Replace `·e·` with `e`                                                                                                                                                            prettier/prettier
   75:36  error  Replace `·'active'·` with `'active'`                                                                                                                                              prettier/prettier
   83:30  error  Replace `·e·` with `e`                                                                                                                                                            prettier/prettier
   84:7   error  Replace `·e.key·===·'Escape'·` with `e.key·===·'Escape'`                                                                                                                          prettier/prettier
   85:18  error  Replace `·e·` with `e`                                                                                                                                                            prettier/prettier
   89:12  error  Delete `·`                                                                                                                                                                        prettier/prettier
   91:38  error  Replace `·'active'·` with `'active'`                                                                                                                                              prettier/prettier
   92:41  error  Replace `·'active'·` with `'active'`                                                                                                                                              prettier/prettier
   93:6   error  Replace `·args.forceEnableDrawer·]·` with `args.forceEnableDrawer]`                                                                                                               prettier/prettier
  108:8   error  Replace `·/*·eslint-disable-next-line·jsx-a11y/no-noninteractive-element-interactions·*/·` with `/*·eslint-disable-next-line·jsx-a11y/no-noninteractive-element-interactions·*/`  prettier/prettier
  110:13  error  Replace `·0·` with `0`                                                                                                                                                            prettier/prettier
  112:13  error  Replace `·drawerRef·` with `drawerRef`                                                                                                                                            prettier/prettier
  113:17  error  Replace `·(·e·)·=>·enableDrawer(·e·)·` with `(e)·=>·enableDrawer(e)`                                                                                                              prettier/prettier
  114:17  error  Replace `·(·e·)·=>·enableDrawer(·e·)·` with `(e)·=>·enableDrawer(e)`                                                                                                              prettier/prettier
  115:16  error  Replace `·(·e·)·=>·disableDrawer(·e·)·` with `(e)·=>·disableDrawer(e)`                                                                                                            prettier/prettier
  116:19  error  Replace `·(·e·)·=>·disableDrawerOnKey(·e·)·` with `(e)·=>·disableDrawerOnKey(e)`                                                                                                  prettier/prettier
  126:13  error  Replace `·'wp-notification-hub'·` with `'wp-notification-hub'`                                                                                                                    prettier/prettier
  127:20  error  Replace `·'active'·` with `'active'`                                                                                                                                              prettier/prettier
  129:13  error  Replace `⏎↹↹↹↹↹↹↹↹↹className={·'wp-notification-hub-wrapper'·}⏎↹↹↹↹↹↹↹↹` with `·className={'wp-notification-hub-wrapper'}`                                                        prettier/prettier
  132:11  error  Delete `·`                                                                                                                                                                        prettier/prettier
  135:16  error  Replace `·(·list,·index·` with `(list,·index`                                                                                                                                     prettier/prettier
  136:25  error  Replace `·index·` with `index`                                                                                                                                                    prettier/prettier
  138:22  error  Replace `·'adminbar'·` with `'adminbar'`                                                                                                                                          prettier/prettier
  139:26  error  Replace `·list.length·` with `list.length`                                                                                                                                        prettier/prettier
  140:21  error  Replace `·index·===·0·` with `index·===·0`                                                                                                                                        prettier/prettier
  143:22  error  Replace `·list·` with `list`                                                                                                                                                      prettier/prettier
  144:14  error  Replace `·...args·` with `...args`                                                                                                                                                prettier/prettier
  147:11  error  Replace `·)·` with `)`                                                                                                                                                            prettier/prettier
  156:12  error  Delete `·`                                                                                                                                                                        prettier/prettier
  159:6   error  Delete `·`                                                                                                                                                                        prettier/prettier
  167:39  error  Replace `·{}·` with `{}`                                                                                                                                                          prettier/prettier

/Users/johnhooks/Projects/wp-feature-notifications/src/stories/Hub-single.stories.js
  27:13  error  Replace `·{·name:·'WordPress',·value:·'#f0f0f1'·}·` with `{·name:·'WordPress',·value:·'#f0f0f1'·}`                                  prettier/prettier
  44:19  error  Replace `·args·` with `args`                                                                                                        prettier/prettier
  46:14  error  Replace `·'wp-notification-hub'·}·style={·{·opacity:·1,·right:·0·}·` with `'wp-notification-hub'}·style={{·opacity:·1,·right:·0·}`  prettier/prettier
  47:13  error  Replace `·...args·}·context={·'adminbar'·` with `...args}·context={'adminbar'`                                                      prettier/prettier
  52:37  error  Replace `·{}·` with `{}`                                                                                                            prettier/prettier

240 problems (240 errors, 0 warnings)
  240 errors and 0 warnings potentially fixable with the `--fix` option.

@johnhooks
Copy link
Collaborator Author

johnhooks commented Apr 3, 2023

The JavaScript files are being flagged as an error by pretter/pretter, and it looks like its counter to the WordPress coding standard. The files its complaining about look right. I'm looking into if something in @wordpress/eslint-plugin/recommend change.

@johnhooks
Copy link
Collaborator Author

johnhooks commented Apr 3, 2023

@erikyo it doesn't look like there have been changes. I'm also getting the same errors in my IDE, VSCode. Do you see the same thing in Webstorm?

@johnhooks
Copy link
Collaborator Author

@Sephsekla Yeah it took me a while to figure how to use custom actions, I couldn't test locally on a previous project and I think I did 44 commits in a single day trying to debug it in the GitHub Actions error logs🤦‍♂️

@johnhooks johnhooks mentioned this pull request Apr 3, 2023
2 tasks
@johnhooks
Copy link
Collaborator Author

johnhooks commented Apr 4, 2023

@erikyo this one is ready for review.

I want to add a release step, but it needs a little more research. Let's merge this and I'll follow up with another PR to work on Issue #187

Copy link
Collaborator

@erikyo erikyo left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

strategy:
fail-fast: false
matrix:
php: ['7.2', '7.4', '8.0']
Copy link
Collaborator

Choose a reason for hiding this comment

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

It doesn't have to delay this (in case it turns out there's a problem), but I'd like to look at adding 8.1 and 8.2 as a followup.

Copy link
Collaborator

@Sephsekla Sephsekla 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! I'll make the change to the required checks so that this can actually be merged.

@johnhooks
Copy link
Collaborator Author

@Sephsekla I do not have permissions to merge this.

@Sephsekla Sephsekla merged commit a93d051 into WordPress:develop Apr 4, 2023
@johnhooks johnhooks deleted the ci/refactor-workflows branch April 5, 2023 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] development tools Setting up and cofniguring tools to help with the development process.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants