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

fix: melos list --cycles should return error exit code for easier integration with CI pipelines #514

Closed
1 task done
mugbug opened this issue May 8, 2023 · 0 comments · Fixed by #523
Closed
1 task done
Assignees
Labels
bug Something isn't working Needs: Triage The issue needs triaging

Comments

@mugbug
Copy link

mugbug commented May 8, 2023

Is there an existing issue for this?

  • I have searched the existing issues.

Version

3.0.1

Description

When melos list --cycles is called and some cycle is found it means something is wrong with the project and we should return an error code to the terminal, but we currently just log an output message with the error information.

Steps to reproduce

  1. Go to a project with multiple repos
  2. Make sure two packages are referencing each other
  3. Run melos list --cycles

Expected behavior

An exit code != 0 to be returned from the CLI.

Screenshots

No response

Additional context and comments

This should be specially useful when calling this command on a CI workflow. By having an exit code != 0, it should be enough to just call this command on the workflow and it will fail if any cycle is detected. Without this change, to add it to a CI workflow, an output check should be added to check if the expected output string was found or not, which is not really ideal since the output string may change without being considered as breaking change.

@mugbug mugbug added bug Something isn't working Needs: Triage The issue needs triaging labels May 8, 2023
@mugbug mugbug changed the title fix: melos list --cycles should return error exit code for easier integration with CI pipelines fix: melos list --cycles should return error exit code for easier integration with CI pipelines May 9, 2023
@blaugold blaugold self-assigned this May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage The issue needs triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants