Skip to content

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 7 commits into from
Mar 15, 2022
Merged

chore: move Code to a submodule #4990

merged 7 commits into from
Mar 15, 2022

Conversation

code-asher
Copy link
Member

Closes #4901.

@code-asher code-asher requested a review from a team March 14, 2022 21:27
@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 14, 2022

Looks like CI is failing - exit code 137

Do we need to up the RAM in CI? 😂

@code-asher
Copy link
Member Author

It looks like it is installing dependencies over and over again, I see the same "installing dependencies for..." line multiple times.

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 14, 2022

Docs preview failing again 🤔

https://github.com/coder/code-server/runs/5544837131?check_suite_focus=true#step:4:18

Error: Resource not accessible by integration

@BrunoQuaresma did you ever figure out how to fix this? I could have sworn it worked when you and I did it. But Asher's PR is from a fork.

@code-asher code-asher changed the title Move Code to a submodule chore: move Code to a submodule Mar 14, 2022
@BrunoQuaresma
Copy link
Contributor

Looks like it is a permission issue with the "comment" action, which is weird
Screen Shot 2022-03-14 at 18 55 01
Looks like it is related to the GITHUB_TOKEN... but I'm not sure if it is needed in this case.

The current setup appears to only rebuild VS Code if the dependencies
change but we need to rebuild it if anything changes.

I also re-enabled the commented out node_modules caches.  They look like
they should work to me with the submodule method.  I think the problem
occurred because Code itself was being installed in the yarn step.
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

Me, having vscode back in code-server repo:

Comment on lines -449 to -454
# TODO@jsjoeio - remove once we switch to submodules.
- name: Create package.json for testing
run: |
mkdir -p ./vendor/modules/code-oss-dev
echo '{ "version": "test" }' > ./vendor/modules/code-oss-dev/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.

Remind me again, we don't need this anymore because it's no longer cached or something?

Copy link
Member Author

@code-asher code-asher Mar 14, 2022

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 under vendor/modules so it did not get restored. Then we tried to read package.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 and package.json will exist.

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 14, 2022

I assumed this still runs locally and we've tested a build from CI (the latter I guess can't until CI passes, but we should before merging)

@code-asher
Copy link
Member Author

I ran it locally with yarn watch, have not ran a build yet though.

@codecov
Copy link

codecov bot commented Mar 14, 2022

Codecov Report

Merging #4990 (c7b157c) into main (184ef68) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4990   +/-   ##
=======================================
  Coverage   71.58%   71.58%           
=======================================
  Files          29       29           
  Lines        1675     1675           
  Branches      373      373           
=======================================
  Hits         1199     1199           
  Misses        405      405           
  Partials       71       71           
Impacted Files Coverage Δ
src/node/main.ts 50.00% <ø> (ø)
src/node/routes/vscode.ts 83.54% <ø> (ø)
src/node/constants.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 184ef68...c7b157c. Read the comment docs.

@code-asher
Copy link
Member Author

I tested the CI build, all seems well.

@code-asher code-asher merged commit 21c7480 into coder:main Mar 15, 2022
@code-asher code-asher deleted the submodule branch March 15, 2022 02:37
TinLe pushed a commit to TinLe/code-server that referenced this pull request Apr 23, 2022
* Move Code to a submodule

Closes coder#4901.

* Base Code cache on hash and re-enable node_modules cache

The current setup appears to only rebuild VS Code if the dependencies
change but we need to rebuild it if anything changes.

I also re-enabled the commented out node_modules caches.  They look like
they should work to me with the submodule method.  I think the problem
occurred because Code itself was being installed in the yarn step.
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.

[Chore]: Switch from yarn to a submodule
3 participants