Skip to content

Add GitHub Codespaces support - https://containers.dev 👀 #437

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 2 commits into from
Jan 4, 2023

Conversation

pilor
Copy link
Contributor

@pilor pilor commented Jan 1, 2023

Adds a devcontainer spec that can be used to spin up a full Changelog development environment in a local container or in Github Codespaces.

Two containers are started (using docker compose). The first (devcontainer) includes everything in runtime.Dockerfile and is the container you land in. The second container contains Postgres.

Once the Codespace is started you start the Contributing.md instructions at the # CONFIGURE APP section and no additional setup is required. The app launches and is accessible at localhost:4000 in a local browser and all tests pass.

@pilor
Copy link
Contributor Author

pilor commented Jan 1, 2023

I recently signed up for the site and noticed some loss of data between what I filled out during sign-up vs what was shown after verifying my e-mail. I had to re-supply a username, github uri, and linkedin uri.

I didn't want to install all the dependencies on my local box so I am using this PR as a prereq to investigate the issue. I'll open an issue (and a PR with a fix if I can figure out Elixir) afterwards.

@jerodsanto
Copy link
Member

This is very cool! Excuse my ignorance, but how do I give this a try in Codespaces?

@pilor
Copy link
Contributor Author

pilor commented Jan 2, 2023

This is very cool! Excuse my ignorance, but how do I give this a try in Codespaces?

You should be able to use the "<> code" dropdown in the upper right I believe. Let me know if there are some permissions quirks since the PR comes from a fork that you don't have direct access to.

https://docs.github.com/en/codespaces/developing-in-codespaces/using-github-codespaces-for-pull-requests

@pilor
Copy link
Contributor Author

pilor commented Jan 2, 2023

Tracked down the profile data loss bug, opened #438

@jerodsanto
Copy link
Member

It works! The only thing I'm seeing as a problem is that opening the app in a browser doesn't link the assets correctly because it's using localhost:4000 and the browser is at https://jerodsanto-legendary-system-q757xvrjcxx5v-4000.preview.app.github.dev. I assume this isn't a problem if you're using VS Code? Or is there some way to tunnel localhost to Codespaces?

@pilor
Copy link
Contributor Author

pilor commented Jan 3, 2023

When using VS Code's desktop client it forwards the port to localhost and everything loads correctly at http://localhost:4000.

I hadn't tried the VS Code web client. I'll play around with it and see if there is an easy way to get assets loading there as well.

@pilor
Copy link
Contributor Author

pilor commented Jan 4, 2023

I can't find a way to detect automatically if a dev is using the VS Code web editor so the "fix" requires a manual env variable setting (see the CONTRIBUTING.md change). However, it does work after following the two steps outlined there.

Developing in desktop VS Code doesn't require any extra steps.

@jerodsanto jerodsanto merged commit 862be9a into thechangelog:master Jan 4, 2023
@jerodsanto
Copy link
Member

@all-contributors please add @pilor for code, doc

@allcontributors
Copy link
Contributor

@jerodsanto

I've put up a pull request to add @pilor! 🎉

@jerodsanto
Copy link
Member

This is super cool, @pilor! Thanks for contributing it. Odds are we'll discuss on Kaizen 9 🎉

@pilor pilor deleted the codespace branch January 4, 2023 16:29
@gerhard gerhard changed the title Add dev container (thus codespaces) support Add GitHub Codespaces support - a.k.a. https://containers.dev Jan 14, 2023
@gerhard gerhard changed the title Add GitHub Codespaces support - a.k.a. https://containers.dev Add GitHub Codespaces support - https://containers.dev 👀 Jan 14, 2023
gerhard added a commit that referenced this pull request Feb 18, 2023
So that contributors are not to forced for everything to build from
scratch. We are also thinking of improving on those Dockerfiles so that
we can make better use of op caching. All of it can be captured as code
that will be used as one big CI/CD pipeline, with sweet caching.

This is a follow-up to #437

Signed-off-by: Gerhard Lazu <[email protected]>
gerhard added a commit to gerhard/changelog.com that referenced this pull request Feb 18, 2023
So that contributors are not to forced for everything to build from
scratch. We are also thinking of improving on those Dockerfiles so that
we can make better use of op caching. All of it can be captured as code
that will be used as one big CI/CD pipeline, with sweet caching.

This is a follow-up to thechangelog#437

Signed-off-by: Gerhard Lazu <[email protected]>
gerhard added a commit that referenced this pull request Feb 26, 2023
So that contributors are not to forced for everything to build from
scratch. We are also thinking of improving on those Dockerfiles so that
we can make better use of op caching. All of it can be captured as code
that will be used as one big CI/CD pipeline, with sweet caching.

This is a follow-up to #437

Signed-off-by: Gerhard Lazu <[email protected]>
@jerodsanto
Copy link
Member

@pilor you really started something with this one! 👏 https://changelog.fm/529

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.

2 participants