Skip to content

Commit 063dd73

Browse files
authored
Fix five app-builder bugs that only surfaced on out-of-the-box tables (#356)
* Fix five app-builder bugs that only surfaced on out-of-the-box tables
1 parent 5381612 commit 063dd73

38 files changed

Lines changed: 4149 additions & 460 deletions
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Functional unit tests for the model-apps plugin, across ubuntu × windows × macos
2+
# and Node 20 × 22.
3+
#
4+
# Why a matrix: these scripts shell out to `pac`/`az`, build filesystem paths, and
5+
# parse CLI output, so path-separator and shell differences are a real regression
6+
# class that a single-OS run would miss. Both Node versions are covered because the
7+
# plugin is developed on Node 22 while the repo's other test workflow pins Node 20 —
8+
# a version-only failure should be attributable, not a mystery.
9+
#
10+
# Deliberately mirrors `power-pages-script-tests.yml` rather than extending it: the
11+
# two plugins have independent path filters, so a change to one must not spend CI
12+
# time on the other.
13+
name: model-apps-script-tests
14+
15+
on:
16+
pull_request:
17+
branches:
18+
- main
19+
paths:
20+
- "plugins/model-apps/**"
21+
# The eval harness lives at the repo root but is owned by this plugin, so
22+
# an eval-only change must still trigger the eval job below.
23+
- "evals/model-apps/**"
24+
- ".github/workflows/model-apps-script-tests.yml"
25+
26+
jobs:
27+
test-model-apps-scripts:
28+
name: test-model-apps-scripts (${{ matrix.os }}, node ${{ matrix.node }})
29+
runs-on: ${{ matrix.os }}
30+
# Defense-in-depth: opt this CI job out of telemetry transmission so a test
31+
# that forgets to isolate emission can never POST to a real collector. The
32+
# plugin's committed ikey.json currently ships `disabled: true`, but that is
33+
# a value that can change; the guard must not depend on it. Suppresses
34+
# TRANSMISSION only — the local diagnostic mirror is still written, so this
35+
# cannot change what the tests actually assert.
36+
env:
37+
POWER_PLATFORM_SKILLS_TELEMETRY_MODEL_APPS_OPTOUT: "1"
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os:
42+
- ubuntu-latest
43+
- windows-latest
44+
- macos-latest
45+
node:
46+
- 20
47+
- 22
48+
steps:
49+
- name: checkout
50+
uses: actions/checkout@v4
51+
52+
- name: setup-node
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: ${{ matrix.node }}
56+
57+
# run-tests.js is the plugin's own regression gate: it runs every
58+
# scripts/tests/*.test.js and exits non-zero on any failure. Invoking it
59+
# (rather than a bare `node --test`) keeps CI and the documented local
60+
# command identical, so a green PR means the same thing a green local run
61+
# does. The vendored SDK's own Jest suite is intentionally NOT run here —
62+
# it needs a Node-20-ABI `canvas` native module and the SDK source tree,
63+
# neither of which exists in this repo; the real-bundle contract tests in
64+
# scripts/tests/ cover the shipped bundle instead.
65+
- name: run-model-apps-script-tests
66+
shell: bash
67+
working-directory: plugins/model-apps
68+
run: node scripts/run-tests.js
69+
70+
test-model-apps-evals:
71+
name: test-model-apps-evals
72+
runs-on: ubuntu-latest
73+
env:
74+
POWER_PLATFORM_SKILLS_TELEMETRY_MODEL_APPS_OPTOUT: "1"
75+
steps:
76+
- name: checkout
77+
uses: actions/checkout@v4
78+
79+
- name: setup-node
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: 20
83+
84+
# The eval harness lives at the repo root (evals/model-apps/**) but is
85+
# owned by this plugin, so it is gated by the same path filter. These are
86+
# the offline scoring/fixture tests only — the Layer 1/2 runners need a
87+
# live Dataverse org and are run manually.
88+
- name: run-model-apps-eval-tests
89+
shell: bash
90+
run: node --test evals/model-apps/app-builder/tests/*.test.js evals/model-apps/genpage/tests/*.test.js

AGENTS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,25 @@ claude --plugin-dir /path/to/plugins/<plugin-name>
4141

4242
No root-level build, lint, or test commands exist. Build/test tooling lives inside each plugin.
4343

44+
## CI
45+
46+
**Only two workflows run on every PR**`validate-keyword-case` and `validate-repository-metadata`.
47+
Both are repo-wide and enforce metadata/marketplace rules, not behavior.
48+
49+
**Every test workflow is path-filtered to a single plugin** (`power-pages``plugins/power-pages/**`;
50+
`model-apps``plugins/model-apps/**` + `evals/model-apps/**`). This is deliberate — a PR should not
51+
spend CI on a plugin it never touched — but it has a corollary: *a green PR does not mean the repo is
52+
green*, only that the paths you touched are.
53+
54+
**A test suite with no workflow silently never runs.** When you add tests to a plugin, add or extend
55+
that plugin's own path-filtered workflow in the same PR; do not widen another plugin's filter to
56+
cover yours.
57+
58+
A plugin that has adopted telemetry must also set its opt-out env var on any job that could execute a
59+
telemetry-emitting hook or script (see `## Shared Telemetry`) — e.g.
60+
`POWER_PLATFORM_SKILLS_TELEMETRY_MODEL_APPS_OPTOUT: "1"`. It suppresses transmission only, so it
61+
cannot change what a test asserts.
62+
4463
## Plugin Conventions
4564

4665
Each plugin follows this structure:

plugins/model-apps/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "model-apps",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "Build model-driven Power Apps end to end: /app-builder authors whole apps (tables, relationships, forms, views, charts, security roles, app + sitemap) from a natural-language intent, and /genpage builds generative pages with specialist agents for planning, entity creation, and parallel code generation. Requires PAC CLI >= 2.7.0 and Azure CLI (`az`). See CHANGELOG.md for v1.x -> v2.x migration.",
55
"author": {
66
"name": "Microsoft",

plugins/model-apps/.plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "model-apps",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "Build model-driven Power Apps end to end: /app-builder authors whole apps (tables, relationships, forms, views, charts, security roles, app + sitemap) from a natural-language intent, and /genpage builds generative pages with specialist agents for planning, entity creation, and parallel code generation. Requires PAC CLI >= 2.7.0 and Azure CLI (`az`). See CHANGELOG.md for v1.x -> v2.x migration.",
55
"author": {
66
"name": "Microsoft",

0 commit comments

Comments
 (0)