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

editor/code: Break down CI steps to know what is failing easily #15281

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

tetsuharuohzeki
Copy link
Contributor

@tetsuharuohzeki tetsuharuohzeki commented Jul 14, 2023

This do the thing I mentioned in #15265 (comment)

This aims to improve CI status check more readable.

I tried to use jobs.<job_id>.if to make the configuration
more shortly once.

But it could not fire the end-success or end-failure status if some jobs in the workflow were skipped. This causes an integration problem with bors.

By their reasons, this patch still uses jobs.<job_id>.steps[*].if.


To do this change, we reorganize npm-script.

previous after
npm run lint npm run lint && npm run format:check
npm run fix npm run lint:fix && npm run format

The previous npm run fix sometimes does not complete fix automatically because ESLint's autofix doees not follow prettier's formatting. So we need to run npm run lint:fix && npm run format by this order.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 14, 2023
@tetsuharuohzeki tetsuharuohzeki force-pushed the split-ci-steps branch 2 times, most recently from 6576c40 to f6b359b Compare July 14, 2023 17:22
@tetsuharuohzeki tetsuharuohzeki marked this pull request as ready for review July 14, 2023 17:35
@tetsuharuohzeki
Copy link
Contributor Author

@lnicola How do you think about this?

I did not do same thing for Rust's CI job because their step has a dependency that affects to CI job performance. I would not like to touch them in this PR to avoid to make this PR more complex.

@lnicola
Copy link
Member

lnicola commented Jul 18, 2023

To be honest, I'm not a fan of this. It's a bunch more complex, and I'm not sure it's worth it over a good comment or message printed in the workflow.

@tetsuharuohzeki
Copy link
Contributor Author

@lnicola

Okay. How only about 19f6f50 ? I think it would be nice balance.

@lnicola
Copy link
Member

lnicola commented Jul 18, 2023

Yeah, that's closer to what I meant.

@tetsuharuohzeki
Copy link
Contributor Author

@lnicola

Thanks. I updated my changeset.

@lnicola
Copy link
Member

lnicola commented Jul 22, 2023

@tetsuharuohzeki thanks, did you see my comments on 19f6f50?

@tetsuharuohzeki
Copy link
Contributor Author

@tetsuharuohzeki did you see my comments on 19f6f50?

Sorry, I missed it.

Is it worth adding this since it's used only in one place? On one hand, it makes sense for someone who doesn't know what tsc is, on the other it's an extra thing to read through.

I think this alias (mom run type check) is useful when upgrading TypeScript to fix an error said by TypeScript compiler as just like cargo check. Thus I added it.

@tetsuharuohzeki
Copy link
Contributor Author

By this commit 6a97fc6 I break down CI step more npm run pretest steps into npm run lint and npm run typecheck

- run: npm run lint
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'

# To fix this steps, please run `npm run format`.
Copy link
Member

@lnicola lnicola Jul 22, 2023

Choose a reason for hiding this comment

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

Why is this twice? Once here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh, that was my mistake. I pushed new patch.

- name: Run VS Code tests (Linux)
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
env:
VSCODE_CLI: 1
run: xvfb-run npm test
working-directory: ./editors/code

# To fix this steps, please run `npm run format`.
Copy link
Member

@lnicola lnicola Jul 22, 2023

Choose a reason for hiding this comment

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

once here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the same reason with above

To do this change, we reorganize npm-script.

| previous           | after                                  |
|--------------------|----------------------------------------|
| `npm run lint`     | `npm run lint && npm run format:check` |
| `npm run fix`      | `npm run lint:fix && npm run format`   |

The previous `npm run fix` sometimes does not complete fix automatically
because ESLint's autofix doees not follow prettier's formatting.
So we need to run `npm run lint:fix && npm run format` by this order.
@lnicola
Copy link
Member

lnicola commented Jul 22, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jul 22, 2023

📌 Commit 5cca093 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 22, 2023

⌛ Testing commit 5cca093 with merge c99bb3c...

@bors
Copy link
Contributor

bors commented Jul 22, 2023

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing c99bb3c to master...

@bors bors merged commit c99bb3c into rust-lang:master Jul 22, 2023
@tetsuharuohzeki
Copy link
Contributor Author

@lnicola Thank you for your review!

@tetsuharuohzeki tetsuharuohzeki deleted the split-ci-steps branch July 22, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants