[v11] web: Ignore .swc directory when computing web SHA #29899
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ignore any
.swc
directories when computing the SHA of SHAs todetermine if
make ensure-webassets
should rebuild the web UI. The.swc
directories are in the.gitignore
file, so should also beignored when computing the SHA of the web files.
On a fresh checkout of
teleport
, runningmake ensure-webassets
causes a plugin to be build or downloaded into
web/packages/teleport/.swc/plugins/v4
. As this is inside the directoryover which the SHA of SHAs is computed, if you re-run
make ensure-webassets
, it ends up rebuilding the web UI for the sameresult. 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 intoother 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.
Also (partial) backport some previous PRs that made minor changes to
build.assets/build-webassets-if-changed.sh
.Issue: #21724
Backport: #29892
Backport: #21822
Backport: #22979 (partial)
Changelog: none