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

feat: Change concurrent log to sequential log #679

Merged
merged 5 commits into from
Mar 27, 2024

Conversation

koji-1009
Copy link
Contributor

Description

issue #668

Improvements melos analyse log so that the output is the same when the -c option is specified as when it is not specified.
The String? group property is added for grouping when logging output. In the case of -c 1, this option is not needed. (Log output is done sequentially.) In the case of -c 2, all logs are output after the process is complete.

Existing buffer-flush was deprecated, so it was named group-buffer for convenience. If that is not good, please point it out. Thanks for the useful tools.

no issue case

main branch log
# koji @ Mochi in ~/packages/melos on git:main o [19:03:18]
$ melos analyze -c 1
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
conventional_commit:
Analyzing conventional_commit...
No issues found!
conventional_commit: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos:
Analyzing melos...
No issues found!
melos: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos_workspace:
Analyzing melos...
No issues found!
melos_workspace: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze
     └> SUCCESS

# koji @ Mochi in ~/packages/melos on git:main o [19:03:24]
$ melos analyze -c 2
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze --concurrency 2
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Analyzing conventional_commit...
Analyzing melos...
No issues found!
No issues found!
Analyzing melos...
No issues found!
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze --concurrency 2
     └> SUCCESS
this branch log
# koji @ Mochi in ~/packages/melos on git:feat/concurrent_log o [19:05:11]
$ melos analyze -c 1
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
conventional_commit:
Analyzing conventional_commit...
No issues found!
conventional_commit: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos:
Analyzing melos...
No issues found!
melos: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos_workspace:
Analyzing melos...
No issues found!
melos_workspace: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze
     └> SUCCESS

# koji @ Mochi in ~/packages/melos on git:feat/concurrent_log o [19:05:18]
$ melos analyze -c 2
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze --concurrency 2
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
conventional_commit:
Analyzing conventional_commit...
No issues found!
conventional_commit: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos:
Analyzing melos...
No issues found!
melos: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos_workspace:
Analyzing melos...
No issues found!
melos_workspace: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze --concurrency 2
     └> SUCCESS

find issue case

main branch log
# koji @ Mochi in ~/packages/melos on git:main o [19:12:36]
$ melos analyze -c 1
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
conventional_commit:
Analyzing conventional_commit...
No issues found!
conventional_commit: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos:
Analyzing melos...

   info - lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
melos: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos_workspace:
Analyzing melos...

   info - packages/melos/lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
melos_workspace: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze
     └> SUCCESS

# koji @ Mochi in ~/packages/melos on git:main x [19:12:51]
$ melos analyze -c 2
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze --concurrency 2
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Analyzing conventional_commit...
Analyzing melos...
No issues found!

   info - lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
Analyzing melos...

   info - packages/melos/lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze --concurrency 2
     └> SUCCESS
this branch log
# koji @ Mochi in ~/packages/melos on git:feat/concurrent_log x [19:14:58]
$ melos analyze -c 1
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
conventional_commit:
Analyzing conventional_commit...
No issues found!
conventional_commit: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos:
Analyzing melos...

   info - lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
melos: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos_workspace:
Analyzing melos...

   info - packages/melos/lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
melos_workspace: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze
     └> SUCCESS

# koji @ Mochi in ~/packages/melos on git:feat/concurrent_log x [19:15:07]
$ melos analyze -c 2
Building package executable...
Built melos:melos.
$ melos analyze
  └> dart analyze --concurrency 2
     └> RUNNING (in 3 packages)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
conventional_commit:
Analyzing conventional_commit...
No issues found!
conventional_commit: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos:
Analyzing melos...

   info - lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
melos: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
melos_workspace:
Analyzing melos...

   info - packages/melos/lib/src/commands/analyze.dart:30:4 - Missing a required trailing comma. - require_trailing_commas

1 issue found.
melos_workspace: SUCCESS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos analyze
  └> dart analyze --concurrency 2
     └> SUCCESS

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

Copy link
Collaborator

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, it looks good!
Could you just add a simple test?

@koji-1009
Copy link
Contributor Author

Sure, I'll give it a try!

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2024

CLA assistant check
All committers have signed the CLA.

@koji-1009 koji-1009 requested a review from spydon March 26, 2024 12:22
@spydon
Copy link
Collaborator

spydon commented Mar 27, 2024

@koji-1009 there seems to be a test failing in this PR

@koji-1009
Copy link
Contributor Author

I'm sorry! I had unintentionally changed the label flag to true when I changed it from logger.stderr to logger.error.

Copy link
Collaborator

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Lgtm, thanks for your contribution!

@spydon spydon merged commit 15b1518 into invertase:main Mar 27, 2024
10 checks passed
@koji-1009 koji-1009 deleted the feat/concurrent_log branch March 27, 2024 14:44
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.

3 participants