-
Notifications
You must be signed in to change notification settings - Fork 153
Add server-logic, cloud-flow, integrate-backend skills and plugin version check #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Priyanshu Agrawal (priyanshu92)
merged 36 commits into
main
from
users/suyashpatel/server-logic-skill
Apr 9, 2026
Merged
Changes from 8 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6e7e827
Add integrate-serverlogic skill for Power Pages Server Logic
8534ae7
Fix server logic file location and add YAML metadata support
710354d
Add table permissions phase for Dataverse connector access
b5b2045
Add web role creation and permissions source choice to server logic s…
76bc1d5
Merge branch 'main' of https://github.com/microsoft/power-platform-sk…
priyanshu92 19443f9
Update command references in SKILL.md
priyanshu92 fa73210
Align server logic skill workflow
priyanshu92 adc1db3
Update server logic skill workflow and bump plugin to v1.2.0
priyanshu92 24e209f
Address Copilot review feedback on server logic skill
priyanshu92 23395fe
Enhance server logic validation and documentation
priyanshu92 aa1d028
Merge remote-tracking branch 'origin/main' into users/suyashpatel/ser…
800bdb5
Rename integrate-serverlogic skill to add-server-logic
176dda0
Fix server-logic validator regex and YAML string quoting
09e3ae7
Add cloud flow skill with intent-based suggestion and re-integration …
cbf4369
Add document.title requirement for create-site page components
ae2d377
Fix serverlogic metadata test to expect single-quoted YAML values
8c7baa1
Prevent render-template from overwriting existing HTML plan files
186ef9b
Fix server-logic skill accuracy and add secrets management workflow
8dfe89a
Add integrate-backend meta skill, fix review findings, add missing tests
2fb0ae3
Fix CI timeout in create-environment-variable test
c6114ca
Fix CI timeout in store-keyvault-secret test and update Playwright MC…
4b1e64c
Add Key Concepts and Implementation Order tabs to backend plan, enabl…
3d97f8a
Fix PR review findings across server-logic, cloud-flow, and integrate…
5a3e680
Fix PR review findings: fileSlug validation and list-cloud-flows test…
d4cae01
Update docs links and improve integrate-backend decision framework
70bc94b
Add plugin version check script and tests
c509d1b
Add plugin version check to all SKILL.md files and update conventions
d167f47
Add CI workflow to enforce version check in SKILL.md files
f90e7cd
Add Azure Key Vault visualization to server logic HTML plan
28fb565
Address PR review comments on validator, plan template, and SKILL.md
e5c7afc
Avoid secret exposure in process listings and fix CI fork safety
9ae9ec2
Fix innerHTML XSS, unused SITE_NAME in script blocks, and cloudflow U…
908459f
Fix cloudflow validator: flowtriggerurl is always empty in Power Pages
261ef57
Add Dataverse custom action discovery and wrapping to server logic skill
541ca31
Address PR review comments: security, robustness, and correctness fixes
074bf92
Fix ER diagram coloring for Mermaid v11 SVG ID prefix change
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/usr/bin/env node | ||
| /** | ||
| * render-serverlogic-plan.js — Renders the server logic plan HTML from a JSON data file. | ||
| * | ||
| * Usage: | ||
| * node render-serverlogic-plan.js --output <path> --data <json-file> | ||
| * | ||
| * Required keys in the JSON data file: | ||
| * SITE_NAME, PLAN_TITLE, SUMMARY, WEB_ROLES_DATA, SERVER_LOGICS_DATA, RATIONALE_DATA | ||
| */ | ||
|
|
||
| const path = require('path'); | ||
| const { renderTemplate, parseArgs } = require('./lib/render-template'); | ||
|
|
||
| const args = parseArgs(process.argv); | ||
|
|
||
| if (!args.output || !args.data) { | ||
| console.error( | ||
| 'Usage: node render-serverlogic-plan.js --output <path> --data <json-file>' | ||
| ); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| renderTemplate({ | ||
| templatePath: path.join( | ||
| __dirname, | ||
| '..', | ||
| 'skills', | ||
| 'integrate-serverlogic', | ||
| 'assets', | ||
| 'serverlogic-plan.html' | ||
| ), | ||
| outputPath: path.resolve(args.output), | ||
| dataPath: path.resolve(args.data), | ||
| requiredKeys: [ | ||
| 'SITE_NAME', | ||
| 'PLAN_TITLE', | ||
| 'SUMMARY', | ||
| 'WEB_ROLES_DATA', | ||
| 'SERVER_LOGICS_DATA', | ||
| 'RATIONALE_DATA', | ||
| ], | ||
| }); |
72 changes: 72 additions & 0 deletions
72
plugins/power-pages/scripts/tests/create-serverlogic-metadata.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| const test = require('node:test'); | ||
| const assert = require('node:assert/strict'); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const { spawnSync } = require('child_process'); | ||
|
|
||
| const { createTempProject } = require('./test-utils'); | ||
|
|
||
| function runCreateServerlogicMetadata(args) { | ||
| const cliPath = path.join( | ||
| __dirname, | ||
| '..', | ||
| '..', | ||
| 'skills', | ||
| 'integrate-serverlogic', | ||
| 'scripts', | ||
| 'create-serverlogic-metadata.js' | ||
| ); | ||
|
|
||
| return spawnSync(process.execPath, [cliPath, ...args], { | ||
| encoding: 'utf8', | ||
| }); | ||
| } | ||
|
|
||
| test('create-serverlogic-metadata writes sorted metadata YAML', (t) => { | ||
| const projectRoot = createTempProject(t); | ||
| const endpointDir = path.join(projectRoot, '.powerpages-site', 'server-logic', 'ticket-dashboard'); | ||
| fs.mkdirSync(endpointDir, { recursive: true }); | ||
| fs.writeFileSync(path.join(endpointDir, 'ticket-dashboard.js'), 'function get() { return "{}"; }\n', 'utf8'); | ||
|
|
||
| const roleIds = [ | ||
| '11111111-1111-1111-1111-111111111111', | ||
| '22222222-2222-2222-2222-222222222222', | ||
| ]; | ||
|
|
||
| const result = runCreateServerlogicMetadata([ | ||
| '--projectRoot', projectRoot, | ||
| '--name', 'ticket-dashboard', | ||
| '--displayName', 'Ticket Dashboard', | ||
| '--description', 'Server-side dashboard aggregation', | ||
| '--webRoleIds', roleIds.join(','), | ||
| ]); | ||
|
|
||
| assert.equal(result.status, 0, result.stderr); | ||
|
|
||
| const parsed = JSON.parse(result.stdout); | ||
| const yaml = fs.readFileSync(parsed.filePath, 'utf8'); | ||
|
|
||
| assert.match(parsed.filePath, /ticket-dashboard\.serverlogic\.yml$/); | ||
| assert.match(yaml, /^adx_serverlogic_adx_webrole:\n - 11111111-1111-1111-1111-111111111111\n - 22222222-2222-2222-2222-222222222222$/m); | ||
| assert.match(yaml, /^description: Server-side dashboard aggregation$/m); | ||
| assert.match(yaml, /^display_name: Ticket Dashboard$/m); | ||
| assert.match(yaml, /^id: [0-9a-f-]{36}$/m); | ||
| assert.match(yaml, /^name: ticket-dashboard$/m); | ||
| }); | ||
|
|
||
| test('create-serverlogic-metadata rejects invalid web role ids', (t) => { | ||
| const projectRoot = createTempProject(t); | ||
| const endpointDir = path.join(projectRoot, '.powerpages-site', 'server-logic', 'ticket-dashboard'); | ||
| fs.mkdirSync(endpointDir, { recursive: true }); | ||
|
|
||
| const result = runCreateServerlogicMetadata([ | ||
| '--projectRoot', projectRoot, | ||
| '--name', 'ticket-dashboard', | ||
| '--displayName', 'Ticket Dashboard', | ||
| '--description', 'Server-side dashboard aggregation', | ||
| '--webRoleIds', 'not-a-uuid', | ||
| ]); | ||
|
|
||
| assert.equal(result.status, 1); | ||
| assert.match(result.stderr, /Invalid UUID in --webRoleIds/); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
plugins/power-pages/scripts/tests/render-serverlogic-plan.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| const test = require('node:test'); | ||
| const assert = require('node:assert/strict'); | ||
| const fs = require('node:fs'); | ||
| const os = require('node:os'); | ||
| const path = require('node:path'); | ||
| const { spawnSync } = require('node:child_process'); | ||
|
|
||
| test('render-serverlogic-plan renders HTML from JSON data', () => { | ||
| const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'serverlogic-plan-')); | ||
| const dataPath = path.join(tempDir, 'data.json'); | ||
| const outputPath = path.join(tempDir, 'serverlogic-plan.html'); | ||
| const scriptPath = path.join( | ||
| __dirname, | ||
| '..', | ||
| 'render-serverlogic-plan.js' | ||
| ); | ||
|
|
||
| fs.writeFileSync( | ||
| dataPath, | ||
| JSON.stringify( | ||
| { | ||
| SITE_NAME: 'Contoso Portal', | ||
| PLAN_TITLE: 'Server Logic Plan', | ||
| SUMMARY: 'Create multiple server logic items for the support portal while keeping role assignment and function design visible in one reviewable plan.', | ||
| WEB_ROLES_DATA: [ | ||
| { | ||
| id: 'authenticated-users', | ||
| name: 'Authenticated Users', | ||
| desc: 'Built-in role for signed-in users.', | ||
| builtin: true, | ||
| isNew: false, | ||
| color: '#8890a4', | ||
| }, | ||
| { | ||
| id: 'support-managers', | ||
| name: 'Support Managers', | ||
| desc: 'Custom role for elevated support dashboards.', | ||
| builtin: false, | ||
| isNew: true, | ||
| color: '#4a7ce8', | ||
| }, | ||
| ], | ||
| SERVER_LOGICS_DATA: [ | ||
| { | ||
| id: 'dashboard-summary', | ||
| name: 'dashboard-summary', | ||
| displayName: 'Dashboard Summary', | ||
| status: 'create', | ||
| apiUrl: 'https://contoso.powerappsportals.com/_api/serverlogics/dashboard-summary', | ||
| webRoles: [ | ||
| { | ||
| id: 'authenticated-users', | ||
| reasoning: 'Authenticated users need the dashboard because it surfaces their assigned work and queue metrics.', | ||
| }, | ||
| { | ||
| id: 'support-managers', | ||
| reasoning: 'Support managers need the same endpoint to review queue-wide workload and escalations.', | ||
| }, | ||
| ], | ||
| rationale: 'This endpoint centralizes support dashboard aggregation on the server.', | ||
| functions: [ | ||
| { | ||
| name: 'get', | ||
| purpose: 'Return dashboard summary data', | ||
| reasoning: 'The dashboard only reads data, so GET is the right fit.', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| id: 'case-export', | ||
| name: 'case-export', | ||
| displayName: 'Case Export', | ||
| status: 'reuse', | ||
| apiUrl: 'https://contoso.powerappsportals.com/_api/serverlogics/case-export', | ||
| webRoles: [ | ||
| { | ||
| id: 'support-managers', | ||
| reasoning: 'Only support managers should initiate exports because the payload includes sensitive case data.', | ||
| }, | ||
| ], | ||
| rationale: 'This existing endpoint is being reused as-is for the export workflow.', | ||
| functions: [ | ||
| { | ||
| name: 'post', | ||
| purpose: 'Start export job', | ||
| reasoning: 'Export initiation changes state, so POST is required.', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| RATIONALE_DATA: [ | ||
| { | ||
| icon: '🛡️', | ||
| title: 'Why this structure', | ||
| desc: 'The plan separates reusable endpoints from newly proposed endpoints so review can focus on real changes.', | ||
| }, | ||
| ], | ||
| }, | ||
| null, | ||
| 2 | ||
| ), | ||
| 'utf8' | ||
| ); | ||
|
|
||
| const result = spawnSync(process.execPath, [scriptPath, '--output', outputPath, '--data', dataPath], { | ||
| encoding: 'utf8', | ||
| }); | ||
|
|
||
| assert.equal(result.status, 0, result.stderr || result.stdout); | ||
| assert.ok(fs.existsSync(outputPath)); | ||
|
|
||
| const html = fs.readFileSync(outputPath, 'utf8'); | ||
| assert.match(html, /Contoso Portal/); | ||
| assert.match(html, /dashboard-summary/); | ||
| assert.match(html, /Authenticated Users/); | ||
| assert.match(html, /Support Managers/); | ||
| assert.match(html, /Case Export/); | ||
| assert.match(html, /assigned work and queue metrics/); | ||
| assert.match(html, /Export initiation changes state/); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.