Skip to content

Commit c044267

Browse files
authored
Merge pull request #17 from metabase/schema-fixes
2 parents 2902611 + 411a9be commit c044267

5 files changed

Lines changed: 34 additions & 32 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
name: Release to NPM
2-
run-name: Release @metabase/representations v${{ inputs.version }} (${{ inputs.npm_tag }})
32

43
on:
4+
push:
5+
branches: [main]
56
workflow_dispatch:
6-
inputs:
7-
version:
8-
description: "Version to publish (e.g. 1.0.0)"
9-
type: string
10-
required: true
11-
npm_tag:
12-
description: "NPM dist-tag"
13-
type: choice
14-
required: true
15-
default: "latest"
16-
options:
17-
- latest
18-
- next
19-
- canary
207

218
jobs:
229
publish:
@@ -32,20 +19,31 @@ jobs:
3219
node-version: "20"
3320
registry-url: "https://registry.npmjs.org"
3421

35-
- name: Set package version
36-
run: npm version ${{ inputs.version }} --no-git-tag-version
22+
- name: Compare local and published versions
23+
id: check
24+
run: |
25+
LOCAL=$(node -p "require('./package.json').version")
26+
PUBLISHED=$(npm view @metabase/representations version 2>/dev/null || echo "none")
27+
echo "local=$LOCAL" >> $GITHUB_OUTPUT
28+
echo "published=$PUBLISHED" >> $GITHUB_OUTPUT
29+
if [ "$LOCAL" != "$PUBLISHED" ]; then
30+
echo "changed=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "changed=false" >> $GITHUB_OUTPUT
33+
fi
3734
3835
- name: Publish to NPM
39-
run: npm publish --tag ${{ inputs.npm_tag }}
36+
if: steps.check.outputs.changed == 'true'
37+
run: npm publish --tag latest
4038
env:
4139
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
4240

4341
- name: Generate workflow summary
4442
run: |
4543
tee -a $GITHUB_STEP_SUMMARY << EOF
46-
## Published @metabase/representations
44+
## @metabase/representations
4745
48-
- **Version**: ${{ inputs.version }}
49-
- **Tag**: ${{ inputs.npm_tag }}
50-
- **Triggered by**: @${{ github.event.sender.login }}
46+
- **Local version**: ${{ steps.check.outputs.local }}
47+
- **Published version**: ${{ steps.check.outputs.published }}
48+
- **Published this run**: ${{ steps.check.outputs.changed }}
5149
EOF

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ for (const result of results) {
5555

5656
## Publishing to NPM
5757

58-
Releases are published via the **Release to NPM** GitHub Actions workflow.
58+
Releases are published automatically by the **Release to NPM** GitHub Actions workflow on every push to `main`. The workflow compares the `version` in `package.json` against the version published on npm and publishes (with the `latest` dist-tag) if they differ.
5959

60-
1. Go to **Actions > Release to NPM > Run workflow**.
61-
2. Enter the version (e.g. `1.1.0`) and pick a dist-tag (`latest`, `next`, or `canary`).
62-
3. Click **Run workflow**.
60+
To cut a release, bump `version` in `package.json` and merge to `main`.
6361

6462
The workflow requires an `NPM_RELEASE_TOKEN` secret with publish access to the `@metabase` npm org.

core-spec/v1/schemas/collection.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ properties:
3939
enum:
4040
- null
4141
- instance-analytics
42+
- library
43+
- library-data
44+
- library-metrics
45+
- trash
46+
- tenant-specific-root-collection
4247
namespace:
4348
type:
4449
- string
@@ -48,6 +53,8 @@ properties:
4853
- null
4954
- transforms
5055
- snippets
56+
- shared-tenant-collection
57+
- tenant-specific
5158
authority_level:
5259
type:
5360
- string

core-spec/v1/schemas/transform.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ properties:
4747
$ref: "common/id.yaml#/$defs/database_id"
4848
type:
4949
type: string
50-
const: table
50+
enum:
51+
- table
52+
- table-incremental
5153
schema:
5254
type:
5355
- string
@@ -173,10 +175,7 @@ $defs:
173175
type: string
174176
description: Table name
175177
table_id:
176-
type:
177-
- integer
178-
- "null"
179-
description: Metabase table ID
178+
$ref: "common/id.yaml#/$defs/table_id"
180179
source-database:
181180
$ref: "common/id.yaml#/$defs/database_id"
182181
source-incremental-strategy:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metabase/representations",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Metabase representation format specification and schema validator",
55
"license": "SEE LICENSE IN LICENSE.txt",
66
"repository": {

0 commit comments

Comments
 (0)