-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tip.cuelang.org: apply the stored patch
This adds a step near the end of CI that unconditionally checks that the patch stored at internal/patch/tip.diff still applies to the repo successfully. CI performs this check by actually applying the patch via _scripts/tipPatchApply.bash - any use of this script leaves the repo in a modified/dirty state. The patch contains changes that make the site compatible with the tip of cue-lang/cue's default branch. A follow-up CL will: 1. add a CI step that runs whenever the default branch of this repo is updated and: - forces the site to use the tip of cue-lang/cue - invokes ./_scripts/regenPostInfraChange.bash - checks that the site builds successfully Later changes might also: 2. publish the site (e.g. to the as-yet-unestablished tip.cuelang.org) after (1) succeeds 3. replicate (1) and (2) any time the default branch of cue-lang/cue is updated; 4. push the working trees generated by (1) and/or (3) to a long-running CL, so that the delta is visible/downloadable/etc. Signed-off-by: Paul Jolly <[email protected]> Change-Id: I8fe2461cd4caa24d12fda7361b5205ae5c871640 Dispatch-Trailer: {"type":"trybot","CL":1200804,"patchset":8,"ref":"refs/changes/04/1200804/8","targetBranch":"master"}
- Loading branch information
Showing
6 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Usage: | ||
# tipPatchApply.bash | ||
# | ||
# tipPatchApply applies the patch stored at $patchPath to the current git | ||
# working tree and index. This patch is intended to make the cuelang.org site | ||
# compatible with the tip version of cue-lang/cue. | ||
|
||
# cd to the parent directory to that containing the script | ||
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.." | ||
|
||
patchPath=$(./_scripts/tipPatchPath.bash) | ||
|
||
# We must be in a clean state first | ||
if test ! -z "$(git status --porcelain)" | ||
then | ||
echo "working tree is not porcelain" | ||
exit 1 | ||
fi | ||
|
||
# --index: working tree and index must be identical. | ||
git apply --index $patchPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Usage: | ||
# tipPatchGenerate.bash | ||
# | ||
# tipPatchGenerate takes the current state of the working tree and stores its | ||
# diff against HEAD at $patchPath. This is intended to ease the ongoing, | ||
# repeated generation of the patch that makes the repo compatible with the tip | ||
# of cue-lang/cue. | ||
|
||
# cd to the parent directory to that containing the script | ||
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.." | ||
|
||
patchPath="$(./_scripts/tipPatchPath.bash)" | ||
|
||
# ":^x" excludes changes to "x" from the diff. | ||
git diff HEAD -- . ":^$patchPath" >"$patchPath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Usage: | ||
# tipPatchPath.bash | ||
# | ||
# tipPatchPath prints the path of the patch file that makes the repo compatible | ||
# with the tip of cue-lang/cue, relative to the repo root. | ||
|
||
echo "internal/patch/tip.diff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/playground/_scripts/revendorToolsInternal.bash b/playground/_scripts/revendorToolsInternal.bash | ||
index 771d24ec..ea3def82 100755 | ||
--- a/playground/_scripts/revendorToolsInternal.bash | ||
+++ b/playground/_scripts/revendorToolsInternal.bash | ||
@@ -29,7 +29,7 @@ popd > /dev/null | ||
|
||
# TODO this is very fragile - we need to move away from this to a proper | ||
# dependency-based approach to minimal copy | ||
-for i in "" filetypes encoding third_party/yaml encoding/yaml astinternal cueexperiment envflag source | ||
+for i in "" filetypes encoding encoding/yaml astinternal cueexperiment envflag source | ||
do | ||
rsync -a --relative --delete $td/$path@$version/internal/./$i/ ./internal/cuelang_org_go_internal/ | ||
find ./internal/cuelang_org_go_internal/$i -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} + |