Skip to content

Commit

Permalink
Add .generated to user.schema.json (#3512)
Browse files Browse the repository at this point in the history
## Description

We've had incidents where new members would edit `user.schema.json`
instead of `user.schema.jsonnet`. Initially we were hoping that
`user.schema.json` being inside `outputs/` was sufficient to signal that
this was an output, not a file to be edited manually, but it appears
that it's not clear enough. This PR renames it to
`user.schema.generated.json` so that it's more clear.


## Checklist
- [x] I have read and understood the [WATcloud
Guidelines](https://cloud.watonomous.ca/docs/community-docs/watcloud/guidelines)
- [x] I have performed a self-review of my code
  • Loading branch information
ben-z authored Dec 30, 2024
1 parent bd1bf6d commit 6ab581e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/onboarding-form.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import userSchemaJSON from "@/build/fixtures/user.schema.json";
import userSchemaJSON from "@/build/fixtures/user.schema.generated.json";
import userSchemaValidate from "@/build/fixtures/user.schema.validate";
import RJSFFields from "@/components/rjsf-fields";
import RJSFTemplates from "@/components/rjsf-templates";
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/services.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If your group is not listed or shows up as `[Legacy]`[^legacy-affiliation], plea

## Service Directory

import userSchemaJSON from "@/build/fixtures/user.schema.json";
import userSchemaJSON from "@/build/fixtures/user.schema.generated.json";
import { lookupStringMDX, userSchemaStrings } from "@/lib/data";

export function ServiceDescriptions() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/compile-json-schema-validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ compileSchemaValidators(
options
);

const userSchemaPath = path.resolve(path.join(inputDir, "user.schema.json"));
const userSchemaPath = path.resolve(path.join(inputDir, "user.schema.generated.json"));
const userSchemaValidatorPath = path.resolve(
path.join(inputDir, "user.schema.validate.js")
);
Expand Down
6 changes: 3 additions & 3 deletions scripts/generate-fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if [ -n "$__fetch_from" ]; then
wget --no-verbose -O "$PROJECT_DIR/build/fixtures/ssh-info.json" "$__fetch_from/ssh-info.json"
wget --no-verbose -O "$PROJECT_DIR/build/fixtures/website-config.json" "$__fetch_from/website-config.json"
wget --no-verbose -O "$PROJECT_DIR/build/fixtures/affiliation.schema.json" "$__fetch_from/affiliation.schema.json"
wget --no-verbose -O "$PROJECT_DIR/build/fixtures/user.schema.json" "$__fetch_from/user.schema.json"
wget --no-verbose -O "$PROJECT_DIR/build/fixtures/user.schema.generated.json" "$__fetch_from/user.schema.generated.json"
wget --no-verbose -O "$PROJECT_DIR/build/fixtures/affiliation-info.json" "$__fetch_from/affiliation-info.json"
wget --no-verbose -O "$PROJECT_DIR/build/fixtures/user-profiles.json" "$__fetch_from/user-profiles.json"
else
Expand All @@ -73,7 +73,7 @@ else
python3 "$SCRIPT_DIR/generate-ssh-info.py" "$PROJECT_DIR/build/fixtures"
python3 "$SCRIPT_DIR/generate-website-config.py" "$PROJECT_DIR/../outputs" "$PROJECT_DIR/build/fixtures"
cp "$PROJECT_DIR/../directory/affiliations/affiliation.schema.json" "$PROJECT_DIR/build/fixtures"
cp "$PROJECT_DIR/../outputs/directory/users/user.schema.json" "$PROJECT_DIR/build/fixtures"
cp "$PROJECT_DIR/../outputs/directory/users/user.schema.generated.json" "$PROJECT_DIR/build/fixtures"
python3 "$SCRIPT_DIR/generate-affiliation-info.py" "$PROJECT_DIR/build/fixtures"
python3 "$SCRIPT_DIR/generate-user-profiles.py" > "$PROJECT_DIR/build/fixtures/user-profiles.json"
fi
Expand All @@ -88,7 +88,7 @@ echo "Generating fixture types..."

echo "Generating mdx files from data..."
python3 "$SCRIPT_DIR/generate-mdx-strings.py" json-to-mdx "$PROJECT_DIR/build/fixtures/ssh-info.json" "$PROJECT_DIR/build/fixtures/ssh-info-strings"
python3 "$SCRIPT_DIR/generate-mdx-strings.py" json-to-mdx "$PROJECT_DIR/build/fixtures/user.schema.json" "$PROJECT_DIR/build/fixtures/user-schema-strings"
python3 "$SCRIPT_DIR/generate-mdx-strings.py" json-to-mdx "$PROJECT_DIR/build/fixtures/user.schema.generated.json" "$PROJECT_DIR/build/fixtures/user-schema-strings"

echo "Compiling JSON schema validators..."
node "$PROJECT_DIR/scripts/compile-json-schema-validators.js" "$PROJECT_DIR/build/fixtures"
Expand Down

0 comments on commit 6ab581e

Please sign in to comment.