chore: generate template dynamically for specific enabled plugins#127
chore: generate template dynamically for specific enabled plugins#127pkosiec wants to merge 2 commits intopkosiec/lakebase-plugin-2from
Conversation
52c4a14 to
884ae23
Compare
7dc17cb to
884eb11
Compare
884eb11 to
cb82241
Compare
280e89e to
1e776a2
Compare
cb82241 to
488f59d
Compare
1e776a2 to
b2e77c6
Compare
fd8adcb to
8e4e80e
Compare
8e4e80e to
5a02a65
Compare
| plugins: [ | ||
| {{.plugin_usages}} | ||
| {{- if .plugins.lakebase}} | ||
| server({ autoStart: false }), |
There was a problem hiding this comment.
since the server is already defined as "requiredByTemplate" it will be added automatically, we don't have to hard code it, what would be nice is to get the config from the manifest and inject it here instead, but I guess that can be added later. But this seems very specific to lakebase so it can extend the routes, maybe we can do this in a different way?
| command: ['npm', 'run', 'start'] | ||
| {{- if .app_env}} | ||
| env: | ||
| {{.app_env}} | ||
| {{- if .plugins.analytics}} | ||
| - name: DATABRICKS_WAREHOUSE_ID | ||
| valueFrom: sql-warehouse | ||
| {{- 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 |
There was a problem hiding this comment.
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
| "@databricks/appkit-ui": "0.9.0", | ||
| "@databricks/sdk-experimental": "^0.14.2", | ||
| "clsx": "^2.1.1", | ||
| "embla-carousel-react": "^8.6.0", |
There was a problem hiding this comment.
I think some of these are being used by some of the components we have, why are we deleting them?
| "lib": ["ES2020"], | ||
|
|
||
| /* Modules */ | ||
| "module": "CommonJS", |
There was a problem hiding this comment.
I wouldn't do this 😅
|
I like the idea of making the template even more dynamic, but there are some things we need to polish 😄. |
First phase of the dynamic template, that works with analytics and/or lakebase plugins.
Resolves https://databricks.atlassian.net/browse/LKB-9681
Video
lakebase-template.mp4
All PRs
apps initflow, remove empty files after template rendering cli#4549Scope
We agreed on the following scope: