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

[v13] web: Ignore .swc directory when computing web SHA #29897

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

camscale
Copy link
Contributor

@camscale camscale commented Aug 2, 2023

Ignore any .swc directories when computing the SHA of SHAs to
determine if make ensure-webassets should rebuild the web UI. The
.swc directories are in the .gitignore file, so should also be
ignored when computing the SHA of the web files.

On a fresh checkout of teleport, running make ensure-webassets
causes a plugin to be build or downloaded into
web/packages/teleport/.swc/plugins/v4. As this is inside the directory
over which the SHA of SHAs is computed, if you re-run
make ensure-webassets, it ends up rebuilding the web UI for the same
result. It should not rebuild the web UI if it hasn't changed. The SHA
of SHAs generated from a fresh checkout of teleport should match another
fresh checkout. This fails as generating the enterprise webassets after
generating the OSS webassets includes the plugin as part of the SHA, and
that is not there on a fresh checkin.

This will make a difference if we want to build the web assets as a
separate step on CI so that the webassets directory can be copied into
other builds. This will allow a later version of node.js to be used to
build the web UI that what may be available on the OS we're building
Teleport on (I'm looking at you, Centos 7).

Fix a shellcheck-reported issue of quoting while we're here.

Issue: #21724
Backport: #29892
Changelog: none

Ignore any `.swc` directories when computing the SHA of SHAs to
determine if `make ensure-webassets` should rebuild the web UI. The
`.swc` directories are in the `.gitignore` file, so should also be
ignored when computing the SHA of the web files.

On a fresh checkout of `teleport`, running `make ensure-webassets`
causes a plugin to be build or downloaded into
`web/packages/teleport/.swc/plugins/v4`. As this is inside the directory
over which the SHA of SHAs is computed, if you re-run
`make ensure-webassets`, it ends up rebuilding the web UI for the same
result. It should not rebuild the web UI if it hasn't changed. The SHA
of SHAs generated from a fresh checkout of teleport should match another
fresh checkout. This fails as generating the enterprise webassets after
generating the OSS webassets includes the plugin as part of the SHA, and
that is not there on a fresh checkin.

This will make a difference if we want to build the web assets as a
separate step on CI so that the `webassets` directory can be copied into
other builds. This will allow a later version of node.js to be used to
build the web UI that what may be available on the OS we're building
Teleport on (I'm looking at you, Centos 7).

Fix a shellcheck-reported issue of quoting while we're here.
@camscale camscale enabled auto-merge August 2, 2023 12:36
@camscale camscale added this pull request to the merge queue Aug 2, 2023
Merged via the queue into branch/v13 with commit 346c853 Aug 2, 2023
21 checks passed
@camscale camscale deleted the bot/backport-29892-branch/v13 branch August 2, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants