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

chore: Introduce 'check' task #3715

Merged
merged 9 commits into from
Mar 27, 2023
Merged

chore: Introduce 'check' task #3715

merged 9 commits into from
Mar 27, 2023

Conversation

fwilhe
Copy link
Contributor

@fwilhe fwilhe commented Mar 21, 2023

Introduce new 'check' task in build, remove dependency-check from compile task.

This change introduces a unified way to run all checks, making it more simple to verify that all of them succeed when developing.

Closes SAP/cloud-sdk-backlog#1076.

@fwilhe fwilhe marked this pull request as draft March 21, 2023 16:30
@fwilhe fwilhe marked this pull request as ready for review March 22, 2023 14:31
Copy link
Contributor

@marikaner marikaner left a comment

Choose a reason for hiding this comment

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

I have one question that I would like to clarify before approving, but I fully agree with the intention. I am actually wondering, whether we shouldn't also remove the postinstall. Because then we would separate concerns even more...

CONTRIBUTING.md Outdated
$ yarn check:MY_CHECK
```

Where `MY_CHECK` can be any of those:
Copy link
Contributor

Choose a reason for hiding this comment

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

[pp] This might be quite outdated soon. In might be easier to point to the package.json/

@@ -61,6 +61,7 @@
"postversion": "yarn generate --force && yarn doc && ts-node scripts/after-bump.ts",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix --force",
"checks": "turbo run check && yarn run check:circular && yarn run check:license && yarn run check:test-service",
Copy link
Contributor

Choose a reason for hiding this comment

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

[q] Why are the checks split between prerequisites for the turbo step and the turbo step? I assume that this is because check:dependencies and check:public-api does not need compilation? Does check:license need it? And do the other checks really "depend on" check:dependencies?

I wonder if this is the reason, can we make it more explicit? Maybe with something like pre-compile-checks and post-compile-checks and then combining them in one check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some of the checks use turbo, and some of them don't (that's the status quo).

Screenshot 2023-03-23 at 10 54 23

My understanding from what @florian-richter explained about the reasoning is that turbo is used for steps which have scripts in packages and thus can benefit from being run in parallel, compared to steps which only operate on the whole project where turbo would not benefit us.

I'm not sure if it has anything todo with 'needs compile' or not.

My first impulse was to put all checks into turbo, but then I wanted to keep the change relatively small and I did not see the large benefit, that's why I've ended up with this multi-command for what "checks" does.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, but then still: Why does the turbo run check step (semantically) depend on the dependency check. The turbo run check should (semantically) execute the dependency check. Technically it will be executed, but the configuration seems unintended to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be my missing knowledge about how to configure turbo, but is there another way to express this? Looking at the docs I don't see it, and we don't seem to do anything else in any of our tasks in turbo json..

},
"test": {
"dependsOn": ["^compile", "^generate"]
},
"check": {
"dependsOn": ["^compile", "check:dependencies", "check:public-api"]
Copy link
Contributor

Choose a reason for hiding this comment

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

[q] Do the packages themselves have a check script? Would the result be the same if there is a check script that executes check:dependencies and check:public-api and only depends on compile.
I am not sure if one approach is preferable than the other. The way it is in the PR now works, so I'm fine if we do it like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand your comment. I think both dependencies and public-api are in all packages, but the other checks are not.

@fwilhe
Copy link
Contributor Author

fwilhe commented Mar 23, 2023

whether we shouldn't also remove the postinstall. Because then we would separate concerns even more

I don't have a strong opinion on that. Are there reasons why one would want to actually install without compile?

Thinking about it, I'd like to separate this discussion because I do see possible arguments why removing the postinstall might be a bad idea which are not related to the intention of this PR.

@fwilhe fwilhe requested review from marikaner and deekshas8 March 23, 2023 13:40
Copy link
Contributor

@marikaner marikaner left a comment

Choose a reason for hiding this comment

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

👍 as discussed

@@ -61,6 +61,7 @@
"postversion": "yarn generate --force && yarn doc && ts-node scripts/after-bump.ts",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix --force",
"checks": "turbo run check && yarn run check:circular && yarn run check:license && yarn run check:test-service",
Copy link
Contributor

@marikaner marikaner Mar 27, 2023

Choose a reason for hiding this comment

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

Just a thought, but as discussed, this would loose turbo's parallelization

Suggested change
"checks": "turbo run check && yarn run check:circular && yarn run check:license && yarn run check:test-service",
"checks": "yarn check:dependencies && yarn check:public-api && yarn check:circular && yarn check:license && yarn check:test-service",

@fwilhe fwilhe merged commit 777a11e into main Mar 27, 2023
@fwilhe fwilhe deleted the improve-turbo-workflow branch March 27, 2023 09:35
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