You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Not every entity needs a profile extension, but check whether existing patterns suggest one is expected.
13
+
14
+
### 2. Junction Entity Patterns
15
+
- Many-to-many relationships use explicit junction entities (e.g., `Film2People`, `Episode2Planets`).
16
+
- New M:N relationships must follow this pattern — no unmanaged associations or link tables.
17
+
- Junction entities should use `managed` + `cuid` from `@sap/cds/common`.
18
+
- Service projections must use `redirected to` for junction navigation.
19
+
20
+
### 3. Service Exposure
21
+
- New entities should be exposed in the relevant `*-service.cds` file.
22
+
- Check that the entity is listed in `cap/srv/services-auth.cds` with an appropriate `@requires` annotation.
23
+
24
+
### 4. Annotation Separation
25
+
- Fiori/UI annotations belong in `*-fiori.cds` files only — never in `*-service.cds`.
26
+
-`Common.ValueList` and `UI.SelectionFields` patterns should be consistent with existing entities.
27
+
28
+
### 5. View Declarations
29
+
- Aggregation views like `Show2Planets` (defined as `define view ... as select from Episode2*`) are not physical tables — verify new views follow this pattern when aggregating over junction tables.
30
+
31
+
### 6. Build Verification
32
+
- Run `cd cap && npm run build` to confirm CDS compilation succeeds.
33
+
- If the build fails, report the exact compiler error.
34
+
35
+
## Tools
36
+
- Use `cds-mcp` to resolve entity and field definitions.
37
+
- Use Grep/Read to check profile extensions and service files.
38
+
- Run `npm run build` in `cap/` to verify compilation.
39
+
40
+
## Output
41
+
Report findings as a checklist with pass/fail status for each category. Flag issues with file paths and line numbers.
"command": "bash -c 'FILE=$(echo \"$TOOL_INPUT\" | sed -n \"s/.*\\\"file_path\\\"[[:space:]]*:[[:space:]]*\\\"\\([^\\\"]*\\)\\\".*/\\1/p\"); case \"$FILE\" in *cdsrc-private*|*default-env*) echo \"BLOCKED: $FILE contains credentials — do not read or modify\"; exit 1;; *) exit 0;; esac'"
27
+
}
28
+
]
29
+
}
30
+
],
31
+
"PostToolUse": [
32
+
{
33
+
"matcher": "Edit|Write",
34
+
"hooks": [
35
+
{
36
+
"type": "command",
37
+
"command": "bash -c 'FILE=$(echo \"$TOOL_INPUT\" | sed -n \"s/.*\\\"file_path\\\"[[:space:]]*:[[:space:]]*\\\"\\([^\\\"]*\\)\\\".*/\\1/p\"); case \"$FILE\" in *.cds) cd d:/projects/cloud-cap-hana-swapi/cap && node node_modules/eslint/bin/eslint.js --no-error-on-unmatched-pattern \"$FILE\" 2>&1 | tail -20 || true;; *) exit 0;; esac'"
description: Run the Wookieepedia scraper, convert data, load into SQLite, and verify with migration and full tests.
4
+
disable-model-invocation: true
5
+
---
6
+
7
+
Run the full data pipeline **sequentially** from the `cap/` directory.
8
+
9
+
## Steps
10
+
11
+
1.**Scrape Star Wars data**
12
+
```bash
13
+
cd cap && npm run scrape
14
+
```
15
+
Uses committed cache by default (fast). If the user requests `--bypass-cache`, ask for explicit confirmation first, then run `npm run scrape:bypass-cache` instead.
16
+
17
+
2.**Build CDS artifacts**
18
+
```bash
19
+
cd cap && npm run build
20
+
```
21
+
22
+
3.**Load fixture data into SQLite**
23
+
```bash
24
+
cd cap && npm run load_sqlite
25
+
```
26
+
27
+
4.**Run migration tests**
28
+
```bash
29
+
cd cap && npm run test:migration
30
+
```
31
+
Verifies data conversion logic and report generation.
32
+
33
+
5.**Run full test suite**
34
+
```bash
35
+
cd cap && npm test
36
+
```
37
+
38
+
## Rules
39
+
40
+
-**Stop on failure.** If any step fails, report the error and do not continue.
41
+
-**Cache-first by default.** Never bypass the scraper cache without user confirmation — fresh fetches hit Wookieepedia and take significantly longer.
42
+
-**Report results.** Summarize each step's outcome: scrape stats, build status, load counts, and test pass/fail/skip.
-**`StarWarsShow`**: Full service exposing `Show`, `Episode`, `Media`, `MediaCharacters`, `Show2People`, `Show2Planets`, and related projections. Has handler logic in `show-service.js` (computes virtual `edit_url` on `Media` reads).
90
+
-**`StarWarsEpisode`**: Read-only projections of `Episodes` and `Episode2*` junctions (no handler logic). Separate CDS file with its own Fiori annotations.
91
+
-**`DataService`** (`/-data`): Entity metadata/introspection service exposing entity names, columns, and types. Handler in `data-service.js`.
@@ -124,14 +137,19 @@ npm run build # copies content + builds to site/.vitepress/dist/
124
137
npm run preview # preview the built site
125
138
```
126
139
127
-
GitHub Actions auto-deploys to GitHub Pages on push to `main` when files under `site/**`, `cap/docs/**`, `cap/labs/**/README.md`, or `HANA_CLI_*.md` change (`.github/workflows/docs.yml`).
128
-
129
140
**Do not commit generated dirs** (`site/guide/`, `site/architecture/`, `site/labs/`, `site/reference/`, `site/api/`, `site/hana-cli/`) — they are git-ignored and regenerated at build time.
130
141
142
+
## CI/CD
143
+
144
+
Two GitHub Actions workflows in `.github/workflows/`:
145
+
146
+
-**`docs.yml`** — auto-deploys the VitePress site to GitHub Pages on push to `main` when `site/**`, `cap/docs/**`, `cap/labs/**/README.md`, `HANA_CLI_*.md`, or `CHANGELOG.md` change.
147
+
-**`migration-tests.yml`** — runs migration unit tests (`npm run test:migration`) on push/PR when `convertData.js`, `convertDataLite.js`, or their tests change.
148
+
131
149
## Key Conventions
132
150
133
151
-**CDS modeling**: Preserve namespace and `managed`/`cuid` patterns. Prefer explicit many-to-many junction entities. Keep `Common.ValueList` and `UI.*` patterns consistent.
134
-
-**Breaking changes**: Avoid renames/removals without migration intent. See `docs/value-help-migration.md` for a past breaking-change example.
135
-
-**Data loading**: Use `convertData.js`for all profiles (handles parallel chunk loading; SQLite-safe). The `load_sqlite` npm script invokes this directly.
136
-
-**Generated folders**: `cap/gen/`is auto-generated. After HANA deployment, re-run `npm run build` if `gen/srv` is cleared.
152
+
-**Breaking changes**: Avoid renames/removals without migration intent. See `cap/docs/value-help-migration.md` for a past breaking-change example.
153
+
-**Data loading**: `convertData.js`handles all profiles (parallel chunk loading; SQLite-safe). `convertDataLite.js` is a lightweight wrapper used by CI. The `load_sqlite` npm script invokes `convertData.js` directly.
154
+
-**Generated folders**: `cap/gen/`and `cap/@cds-models/` are auto-generated. After HANA deployment, re-run `npm run build` if `gen/srv` is cleared.
137
155
-**cds-mcp**: When editing CDS files, resolve entity/field definitions with `cds-mcp` before modifying models, and check CAP docs via `cds-mcp` before proposing CDS syntax or API usage.
Copy file name to clipboardExpand all lines: docs/superpowers/specs/2026-04-17-tip-rotation-design.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,9 @@ type Config struct {
32
32
}
33
33
```
34
34
35
-
`Default()`sets `Tip: TipConfig{Rotation: "daily"}`. An empty `Rotation` string is treated as `"daily"` so existing config files without the key continue to work.
35
+
`Default()`leaves `Rotation` as `""` (the Go zero value). `tipSeed` treats `""`as `"daily"`at runtime, so existing config files without a `tip` block behave identically to new configs.
36
36
37
-
The `tip` block is omitted from `config.yaml` until the user explicitly sets a value (`omitempty`).
37
+
The `tip` block is omitted from `config.yaml` until the user explicitly sets a value — `TipConfig{Rotation: ""}` is the zero value and `omitempty` suppresses it.
0 commit comments