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

⚡️ Improve melos and workflow setup #2021

Merged
merged 10 commits into from
Nov 9, 2023
Merged

⚡️ Improve melos and workflow setup #2021

merged 10 commits into from
Nov 9, 2023

Conversation

AlexV525
Copy link
Member

@AlexV525 AlexV525 commented Nov 2, 2023

  • Reduce separate workflows and matrices to the minimum (30+3).
  • Add a script to apply file patches for corresponding SDKs.
  • Add a script to produce .melos_ignored_packages for steps.
  • Annotate test platforms for plugins.
  • Fix linter recognition between Dart SDK versions.

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

Melos has poor support around versions and packages filtering. It has MELOS_PACKAGES and packageFilter for sessions, but those fields are not working well across its major versions.

The main idea about filtering our packages is to prevent unsatisfied packages from being handled by melos process. For example, if native_dio_adapter requires Flutter 3.13.0 and the current Flutter is 2.15.1, exclude it from packages.

To do this, I've added a script to serialize the melos workspace first, then determine whether the Dart version satisfies the package version. It produces package lists according to demand (satisfied packages or ignored packages).

@AlexV525 AlexV525 added the infra label Nov 2, 2023
@AlexV525 AlexV525 self-assigned this Nov 2, 2023
@AlexV525

This comment was marked as resolved.

scripts/sdk_satisfaction Outdated Show resolved Hide resolved
@AlexV525
Copy link
Member Author

AlexV525 commented Nov 4, 2023

Melos. :)

@AlexV525
Copy link
Member Author

AlexV525 commented Nov 5, 2023

See the edited top comment for more info.

@AlexV525 AlexV525 marked this pull request as ready for review November 5, 2023 15:10
@AlexV525 AlexV525 requested a review from a team as a code owner November 5, 2023 15:10
@AlexV525
Copy link
Member Author

AlexV525 commented Nov 5, 2023

Also cc @CaiJingLong to see if you have any idea regarding infrastructure abstraction abilities.

@kuhnroyal
Copy link
Member

Personally, I don't like the combination of format/analyze/tests as this makes it harder to determine why the build failed, especially for new contributors.
Are there any CI limits reached regarding execution time or matrixes?

@AlexV525
Copy link
Member Author

AlexV525 commented Nov 7, 2023

Personally, I don't like the combination of format/analyze/tests as this makes it harder to determine why the build failed, especially for new contributors.

Good point. If we break it into steps, would it be good enough too?

Are there any CI limits reached regarding execution time or matrixes?

As far as I know there are no limitations for public repos.

@AlexV525 AlexV525 force-pushed the feat/improve-melos branch 5 times, most recently from da43df1 to 74fa978 Compare November 7, 2023 07:51
@AlexV525
Copy link
Member Author

AlexV525 commented Nov 7, 2023

https://github.com/cfug/dio/actions/runs/6785748920/job/18444745192

Steps were split in the job. Now you're able to identify every verify step in a single workflow.
image

The core is time trade with speed. If we still use job strategies, it will cost massive redundant time since the workspace needs to be reconfigured each time a job starts. But it can display every action as a workflow.

Copy link
Contributor

@CaiJingLong CaiJingLong left a comment

Choose a reason for hiding this comment

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

LGTM

@AlexV525 AlexV525 added this pull request to the merge queue Nov 9, 2023
Merged via the queue into main with commit d427b50 Nov 9, 2023
3 checks passed
@AlexV525 AlexV525 deleted the feat/improve-melos branch November 9, 2023 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants