-
Notifications
You must be signed in to change notification settings - Fork 6k
chore: move Code to a submodule #4990
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
98053a0
Move Code to a submodule
code-asher 7ebf071
Base Code cache on hash and re-enable node_modules cache
code-asher 6ba19d2
fixup! Move Code to a submodule
code-asher 4233ca7
Prevent infinite install loop
code-asher 286cb34
Run fmt and lint
code-asher da70f66
fixup! Move Code to a submodule
code-asher c7b157c
fixup! Move Code to a submodule
code-asher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,3 @@ | ||
[submodule "lib/vscode"] | ||
path = lib/vscode | ||
url = https://github.com/coder/vscode |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,50 +1,32 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
main() { | ||
cd "$(dirname "$0")/../.." | ||
source ./ci/lib.sh | ||
|
||
pushd test | ||
echo "Installing dependencies for $PWD" | ||
yarn install | ||
popd | ||
|
||
# Install dependencies in $1. | ||
install-deps() { | ||
local args=(install) | ||
if [[ ${CI-} ]]; then | ||
args+=(--frozen-lockfile) | ||
fi | ||
|
||
pushd test | ||
echo "Installing dependencies for $PWD" | ||
yarn "${args[@]}" | ||
popd | ||
|
||
pushd test/e2e/extensions/test-extension | ||
# If there is no package.json then yarn will look upward and end up installing | ||
# from the root resulting in an infinite loop (this can happen if you have not | ||
# checked out the submodule yet for example). | ||
if [[ ! -f "$1/package.json" ]]; then | ||
echo "$1/package.json is missing; did you run git submodule update --init?" | ||
exit 1 | ||
fi | ||
pushd "$1" | ||
echo "Installing dependencies for $PWD" | ||
yarn "${args[@]}" | ||
popd | ||
} | ||
|
||
pushd vendor | ||
echo "Installing dependencies for $PWD" | ||
|
||
# We install in 'modules' instead of 'node_modules' because VS Code's | ||
# extensions use a webpack config which cannot differentiate between its own | ||
# node_modules and itself being in a directory with the same name. | ||
args+=(--modules-folder modules) | ||
|
||
# We ignore scripts because NPM/Yarn's default behavior is to assume that | ||
# devDependencies are not needed, and that even git repo based packages are | ||
# assumed to be compiled. Because the default behavior for VS Code's | ||
# `postinstall` assumes we're also compiled, this needs to be ignored. | ||
args+=(--ignore-scripts) | ||
|
||
yarn "${args[@]}" | ||
|
||
# Finally, run the vendor `postinstall` | ||
yarn run postinstall | ||
main() { | ||
cd "$(dirname "$0")/../.." | ||
source ./ci/lib.sh | ||
|
||
popd | ||
install-deps test | ||
install-deps test/e2e/extensions/test-extension | ||
install-deps lib/vscode | ||
jsjoeio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
main "$@" |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me again, we don't need this anymore because it's no longer cached or something?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think the problem was that we cache
node_modules
and then restore that cache. But Code is undervendor/modules
so it did not get restored. Then we tried to readpackage.json
from it.Now that this uses a submodule and we have
submodules: true
in the checkout stage Code will be cloned as part of the checkout phase andpackage.json
will exist.