-
Notifications
You must be signed in to change notification settings - Fork 3
chore: migrate all Coder modules to Registry repo #4
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
Conversation
@@ -0,0 +1,6 @@ | |||
{ |
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.
Truth be told, I don't really know what this file does. I just copied it over verbatim
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.
This is VSCode setting to prevent it from indexing or searching in tfstate files.
@@ -0,0 +1,26 @@ | |||
#!/usr/bin/env sh |
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.
More Bash I don't understand, but this file seemed especially important for showing someone how to make a module
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.
Yes, this is needed to bootstrap a new module. we can rewrite it as per the new directory structure later.
// they're part of the form. Avoids CSS stacking context issues, maybe? | ||
/** @type {HTMLLIElement | null} */ | ||
const protocolOption = document.querySelector( | ||
// biome-ignore lint/style/useTemplate: Have to skip interpolation for the main.tf interpolation |
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.
Added Biome warnings so that someone doesn't accidentally change these to template literal syntax in the future, without realizing that it'll break the entire module
@@ -0,0 +1,25 @@ | |||
{ |
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.
We previously had a weird franken-tsconfig file for the entire modules repo, because it was using modern modules for the server, but was restricted to an older browser-specific target as far as what features you could use
I remembered that you can chain tsconfig files, though, so I made the root file as modern/server-specific as possible, and then made this ad-hoc file be co-located with the module
"paths": { | ||
// Not the biggest fan of relative paths in TypeScript projects, but it | ||
// does make things easier for non-Coder contributors to get tests | ||
// imported and set up | ||
"~test": ["./test/test.ts"] | ||
} |
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.
I know Kayla's really gotten mad the few times people have tried to bring these into core, but I figured that it would be one fewer pain points for an outside contributor, since this repo's structure is going to be so much simpler, comparatively
// This is a fix for when you try to run the tests from a Coder workspace. | ||
// When process.env is destructured into the object, it can sometimes have | ||
// workspace-specific values, which causes the resulting URL to be different | ||
// from what the tests have classically expected. | ||
childEnv.CODER_AGENT_URL = undefined; | ||
childEnv.CODER_WORKSPACE_NAME = undefined; |
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.
I don't know when the last time someone ran the Bun tests locally was, but this was breaking for me, when it definitely wasn't last year (when I made the windows-rdp module)
@@ -0,0 +1,36 @@ | |||
name: deploy-registry |
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.
@bcpeinhardt I copied this file over directly, but do we need to change anything to make sure that it runs correctly, now that this is in a different repo?
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.
Can we deploy this new architecture in parallel to the current one just to make sure we do not break existing stuff?
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.
This is huge Michael. Thanks for making this look so effortless.
I have a PR in progress for updating |
Addresses part of coder/internal#532 (but doesn't fully close it out).
This is a huge PR, but chunking it up seemed pointless, since we're largely copying over existing files. I'm going to try commenting on the main areas I think are worth paying attention to
Changes made
tsconfig.json
file to use modern libraries when run from the server, and made a customtsconfig.json
just for thewindows-rdp
module (which has more restrictive browser concerns)Notes
lint.ts
file that provided some light validation of some of the modules. After going through it, there were so many bugs and issues with the code that I legitimately think that it barely provided a safety net at all. I got rid of it entirely, with the intention of adding the functionality that was originally intended to the current validation logic (to be handled in a separate PR)..images
directory, because it felt like it would be chaos if a bunch of users try to throw all their images in one giant directory, with no guidelines on how to do it. I instead made it so that images should be scoped by namespace, which felt a lot more manageable. The.icons
directory is still at the top level, because realistically, there are only going to be so many types of icons referenced, so it's fine for those to be shared.maintainer_github
andcontributor_github
fields make sense anymore, but those can be stripped out once we've updated the Registry site build step to use the new Registry repocontributors
string list to indicate which other users have contributed meaningfully to it. We can then add validation to make sure that every value in that list exists as another namespace in the repoWhat still needs to be migrated (in separate PRs)
These are the main files of interest that still probably need to be copied over from the
/modules
repo:new.sh
terraform_validate.sh
update-version.sh
They're probably going to require enough changes that it's worth handling them in a separate PR.