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

CPP-2161 proof of concept parallel tasks #679

Draft
wants to merge 363 commits into
base: main
Choose a base branch
from
Draft

Conversation

apaleslimghost
Copy link
Member

@apaleslimghost apaleslimghost commented Jul 30, 2024

implements parallel task running in userland using a task with options, which looks like:

commands:
  run:local:
    - Parallel:
        tasks:
          - Node:
              entry: server/index.js
          - Webpack:
              watch: true

also includes some refactoring to the core that was necessary to get this working, and some refactoring that turned out not to be necessary

still to do

  • tests
  • update tasks that run in background to wait
  • use parallel for preset plugins where they're expecting tasks to background

apaleslimghost and others added 30 commits April 9, 2024 17:44
…compatible

Slightly more backwards compatible
…ions

Backwards compatible .toolkitrc options field
…atible-well-sort-of

Even more backwards compatible (well sort of)
fix: remove check for undefined commands
chore: remove duplicate runInit call in runTasks
Following on from similar changes to the PackageJson hook, the CircleCI
hook is now configured via Tool Kit options in .toolkitrc.yml files
instead of modifying shared state in JavaScript functions. This creates
a declarative approach instead of the old functional approach, which
should make configuration much easier to reason with and less abstract,
as well as more flexible, allowing for different kinds of workflows.

With this initial commit I've focused on getting the configuration
generated for next-static to be functionally equivalent to what was
generated previously. Subsequent work will be done to make the config
generated better than what was previously generated, and to support a
more diverse range of project types.
This will be useful if, for example, a project doesn't want the tool-kit
workflow, or the Tool Kit orb. It also allows our tests to be simpler
as we only have to account for the options we've explicitly specified.
CPP-1747 CPP-1748 CPP-1822 Define CircleCI configuration declaratively in .toolkitrc.yml
This creates much simpler config for the majority of projects (i.e.,
projects that don't need to test against multiple versions of Node.)
Don't generate matrices in CircleCI config if only one Node version is being tested
ivomurrell and others added 26 commits May 17, 2024 14:54
Manually bump updated prerelease packages
This partially reverts d1374d1, which I think was a mistake as we
already remove the EOL character normally added by winston, and we skip
appending a newline character to messages if it has a `process`
attribute. So it meant that the only newlines that would be preserved
were ones that happened to not be at the end (or start) of a stream
flush.
Because we were declaring a regex within a template literal we needed to
escape the backslash in the `\s` whitespace meta group. I we don't, the
backslash is parsed as an escape character for the template literal, not
the regex, and is replaced with a literal `s` as `\s` is not a valid
escape sequence. This means the regex would search for an `s` instead of
whitespace. This doesn't affect the unescaped `\n` as the escaped `\n`
and the literal `0x0A` ASCII character are (roughly) equivalent in a
regex.

Instead of fixing the incorrect `\s`, let's remove it entirely and not
trim whitespace characters, just newlines, as I'm not sure we actually
want to strip indentation from hooked console logging.
Fix lack of newlines in subprocess logging
Manually bump updated prerelease packages
build: update and simplify create-plugin script
fix: allow multiple instances of task with different options
@apaleslimghost apaleslimghost requested a review from a team as a code owner July 30, 2024 10:52
@apaleslimghost apaleslimghost marked this pull request as draft July 30, 2024 10:53
Base automatically changed from split-config-loading to main October 1, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants