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

Introduce github workflows for cspell and textlint #2971

Merged
merged 26 commits into from
Jul 6, 2023

Conversation

svrnm
Copy link
Member

@svrnm svrnm commented Jul 5, 2023

With all files in content/ being clean right now we are ready to introduce cspell & textlint as github workflows.

@svrnm svrnm requested a review from a team July 5, 2023 07:06
.gitignore Outdated Show resolved Hide resolved
Copy link
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

I'd like to suggest that this PR only introduce github workflows for cspell and textlint, without attempting any optimizations for any of the GH actions (new or existing). Optimizations should be addressed and discussed separately IMHO.

For example, the choice to not commit package-lock.json is deliberate: it is a royal pain to have to deal with that file in merge and rebase conflicts -- it's just not worth it for a website that isn't, say, a single-page app.

I have an idea of how to optimize the GH actions without it, but just haven't had the time to investigate, given that optimizing seconds off (ok half a minute :)) of GH actions hasn't been a priority.

WDYT?

package.json Outdated Show resolved Hide resolved
@svrnm
Copy link
Member Author

svrnm commented Jul 5, 2023

I'd like to suggest that this PR only introduce github workflows for cspell and textlint, without attempting any optimizations for any of the GH actions (new or existing). Optimizations should be addressed and discussed separately IMHO.

For example, the choice to not commit package-lock.json is deliberate: it is a royal pain to have to deal with that file in merge and rebase conflicts -- it's just not worth it for a website that isn't, say, a single-page app.

I have an idea of how to optimize the GH actions without it, but just haven't had the time to investigate, given that optimizing seconds off (ok half a minute :)) of GH actions hasn't been a priority.

WDYT?

I got carried away a little bit while playing around with this PR, so yes, let me only introduce the workflows for cspell & textlint and remove the rest:-)

@svrnm
Copy link
Member Author

svrnm commented Jul 5, 2023

@chalin all green, all addressed hope this works for you :-)

@chalin
Copy link
Contributor

chalin commented Jul 5, 2023

got carried away a little bit while playing around with this PR

No worries, I understand! Taking a look now.

@chalin chalin force-pushed the add-cspell-and-textlint-to-workflows branch from 0fdf9c5 to f270ea4 Compare July 5, 2023 17:19
Copy link
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

Very nice, thanks!

See inline comments and questions.

.github/workflows/check-spelling.yml Outdated Show resolved Hide resolved
.github/workflows/check-spelling.yml Outdated Show resolved Hide resolved
.github/workflows/check-text.yml Show resolved Hide resolved
.github/workflows/check-text.yml Show resolved Hide resolved
- uses: actions/checkout@v3
# Make sure that we only install the dependencies for textlint to speed up install
- run: |
jq 'del(.dependencies) | .scripts |= with_entries(select(.key | contains("check:"))) | .devDependencies |= with_entries( select(.key | startswith("textlint")))' package.json > package2.json && mv package2.json package.json
Copy link
Contributor

Choose a reason for hiding this comment

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

A few questions:

  • Why prune the scripts?
  • Simplify
    package.json > package2.json && mv package2.json package.json
    to just
    package.json > package.json?

Copy link
Member Author

Choose a reason for hiding this comment

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

  • if I don't prune the scripts it runs all of the npm install dependencies which loads submodules, etc., which is a big hit on performance
  • because if I do jq package.json > package.json the input file is overwritten and I get an empty file

Copy link
Contributor

Choose a reason for hiding this comment

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

  • For scripts, all you should need is to removed prepare -- I don't know if that can help simplify the jq arguments.
  • Ok (re file override)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, actually, without modifying scripts, you can avoid prepare being run by adding the --ignore-scripts flag to the two npm commands below.

Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
Copy link
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

LGTM, other than possibly using the --ignore-scripts flag as mentioned in the inline comment.

@svrnm
Copy link
Member Author

svrnm commented Jul 6, 2023

LGTM, other than possibly using the --ignore-scripts flag as mentioned in the inline comment.

fixed. TY

@svrnm svrnm merged commit c11aa76 into open-telemetry:main Jul 6, 2023
8 checks passed
@svrnm svrnm deleted the add-cspell-and-textlint-to-workflows branch July 6, 2023 09:55
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.

2 participants