-
Notifications
You must be signed in to change notification settings - Fork 3
chore: generate template dynamically for specific enabled plugins #127
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
+1,845
−902
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
74ad2b3
feat(template): generate template dynamically for specific enabled pl…
pkosiec 29b921a
chore: fix bugs for template
pkosiec 900ca19
chore: fix dependencies
pkosiec 97d1d3d
chore: simplify the SQL to execute
pkosiec 8275470
chore: update Readme
pkosiec 5dc9f6f
chore: revert switching to CommonJS
pkosiec 762f875
chore: unhide Lakebase plugin
pkosiec 88672a5
chore: remove unused imports
pkosiec 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
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,7 +1,15 @@ | ||
| DATABRICKS_HOST=https://... | ||
| {{- if .dotenv_example}} | ||
| {{.dotenv_example}} | ||
| {{- if .dotEnv.example}} | ||
| {{.dotEnv.example}} | ||
| {{- end}} | ||
| {{- if .plugins.lakebase}} | ||
| PGHOST=your-lakebase-host.databricks.com | ||
| PGDATABASE=databricks_postgres | ||
| # Run: databricks postgres list-endpoints projects/{project-id}/branches/{branch-id} | ||
| LAKEBASE_ENDPOINT=projects/<project-id>/branches/<branch-id>/endpoints/<endpoint-id> | ||
| # PGUSER=your_user # optional, defaults to DATABRICKS_CLIENT_ID | ||
| PGSSLMODE=require | ||
| {{- end}} | ||
| DATABRICKS_APP_PORT=8000 | ||
| DATABRICKS_APP_NAME={{.project_name}} | ||
| DATABRICKS_APP_NAME={{.projectName}} | ||
| FLASK_RUN_HOST=0.0.0.0 |
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,7 +1,18 @@ | ||
| {{if ne .profile ""}}DATABRICKS_CONFIG_PROFILE={{.profile}}{{else}}DATABRICKS_HOST={{.workspace_host}}{{end}} | ||
| {{- if .dotenv}} | ||
| {{.dotenv}} | ||
| {{- if ne .profile ""}} | ||
| DATABRICKS_CONFIG_PROFILE={{.profile}} | ||
| {{- else}} | ||
| DATABRICKS_HOST={{.workspaceHost}} | ||
| {{- end}} | ||
| {{- if .dotEnv.content}} | ||
| {{.dotEnv.content}} | ||
| {{- end}} | ||
| {{- if .plugins.lakebase}} | ||
| PGHOST='' # Copy from the Lakebase Postgres UI | ||
| PGDATABASE='databricks_postgres' # Copy from the Lakebase Postgres UI | ||
| LAKEBASE_ENDPOINT='' # Run: databricks postgres list-endpoints projects/{project-id}/branches/{branch-id} | ||
| # PGUSER='' # optional, defaults to DATABRICKS_CLIENT_ID | ||
| PGSSLMODE=require | ||
| {{- end}} | ||
| DATABRICKS_APP_PORT=8000 | ||
| DATABRICKS_APP_NAME={{.project_name}} | ||
| DATABRICKS_APP_NAME={{.projectName}} | ||
| FLASK_RUN_HOST=0.0.0.0 |
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,5 +1,17 @@ | ||
| command: ['npm', 'run', 'start'] | ||
| {{- if .app_env}} | ||
| env: | ||
| {{.app_env}} | ||
| {{- if .appEnv}} | ||
| {{.appEnv}} | ||
| {{- end}} | ||
| {{- if .plugins.lakebase}} | ||
| - name: PGHOST | ||
| value: "" # Copy from the Lakebase Postgres UI | ||
| - name: PGDATABASE | ||
| value: "databricks_postgres" # Copy from the Lakebase Postgres UI | ||
| - name: LAKEBASE_ENDPOINT | ||
| value: "" # Run: databricks postgres list-endpoints projects/{project-id}/branches/{branch-id} | ||
| - name: PGSSLMODE | ||
| value: "require" | ||
| # - name: PGUSER | ||
| # value: "" # optional, defaults to DATABRICKS_CLIENT_ID | ||
| {{- end}} | ||
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
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.
this is all very coupled to each plugin, right now the cli populates the env vars based on the resources from the manifest so we wouldn't need this for analytics.
I wonder if we can make it in a different way for lakebase so we can keep what we had instead of putting ifs all around checking for each plugin
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.
Sorry, you're right, we should use
.appEnv. I'll change it 👍But for Lakebase, it is still be manual as I want to ensure there are comments near those envs for guidance. I don't see any better way to define this, unless there's a way on plugin manifest to provide env with additional comment - I don't think so? On the other hand, I don't think it makes sense to build it into the plugin manifest 🤔
Please keep in mind that we'll do the ifs in the template anyway - at least for now. The more "dynamic" the template is, the more complex the structure and syntax is. In the current scale, IMO it's better to add routes / menu links based on
ifwith a given plugin name, instead of having a slice and registering them dynamically which adds significant amount of complexity.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.
(Replaced with
appEnvbut still have the special Lakebase case)