Skip to content

chore: extract constants package #282

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 1 commit into from
Jul 29, 2024
Merged

chore: extract constants package #282

merged 1 commit into from
Jul 29, 2024

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Jul 26, 2024

Part of coder/internal#11

open to naming this something else, but constants was what came to mind first.

@johnstcn johnstcn requested a review from mafredri July 26, 2024 12:41
@johnstcn johnstcn self-assigned this Jul 26, 2024
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

I'm not super stoked about constants, but not a blocker for merge. We can always revert/restructure (again) later.

// to skip building when a container is restarting.
// e.g. docker stop -> docker start
MagicFile = filepath.Join(MagicDir, "built")
)
Copy link
Member

Choose a reason for hiding this comment

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

I do feel like this and options belong in the same package, how about merging them under core or something? Not sure it's better description wise but still. Ideally I'd love for these and options to be in the package named envbuilder since that makes the most sense. But then we either lose the separation, or need to move the Run method elsewhere.

I suppose a build package could be appropriate for those, but then we'd kinda revert some of the splits you've already been doing.

@@ -0,0 +1,31 @@
package constants
Copy link
Member

Choose a reason for hiding this comment

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

Two alternatives, config and defaults. Not sure if/which would be better.

Copy link
Member Author

Choose a reason for hiding this comment

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

I personally dislike both of those options 😅 but I don't have a better proposal.

@johnstcn johnstcn requested a review from dannykopping July 29, 2024 14:52
@johnstcn johnstcn merged commit cc0b4c5 into main Jul 29, 2024
4 checks passed
@johnstcn
Copy link
Member Author

I'm going to go ahead and merge this. We can rename / break this up more later if needed.

@johnstcn johnstcn deleted the cj/pkg-constants branch July 29, 2024 16:20
johnstcn added a commit that referenced this pull request Jul 31, 2024
Builds on top of #282 and #283:

- Extracts the logic for --get-cached-image to a separate function
- Also pulls out some other common logic shared between Run and RunCacheProbe.
johnstcn added a commit that referenced this pull request Aug 5, 2024
Signed-off-by: Cian Johnston <[email protected]>
(cherry picked from commit cc0b4c5)
johnstcn added a commit that referenced this pull request Aug 5, 2024
Builds on top of #282 and #283:

- Extracts the logic for --get-cached-image to a separate function
- Also pulls out some other common logic shared between Run and RunCacheProbe.

(cherry picked from commit cacbcb8)
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