Skip to content

Allow proper setting of CI-RpaaSRPNotInPrivateRepo #36405

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scbedd
Copy link
Member

@scbedd scbedd commented Aug 1, 2025

This is the plan. The necessary changes to remove processing of this value in impact.ts will come in a follow-up PR.

Instead we will check the outcome of this build (which WILL be eventually consistent because of the triggers) which will end up adding the CI-RpaaSRPNotInPrivateRepo in summarize-checks after confirming that the PR:

  • changes an RPaaS folder
  • targets main
  • includes resourcemanager label

Need to figure out a good way to test this new PR without merging it.

Copy link

openapi-pipeline-app bot commented Aug 1, 2025

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.

Copy link

PR validation pipeline started successfully. If there is ApiView generated, it will be updated in this comment.

@scbedd scbedd self-assigned this Aug 1, 2025
paths:
include:
# Trigger for files that will result in a specification change
- specification/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- specification/**
- specification/**/resource-manager/**

Could we limit to only PRs impacting swaggers under the resource-manager folder?


jobs:
- job: PresentInRPaaSCheck
name: Check RP Presenence in RPSaaSMaster
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: Check RP Presenence in RPSaaSMaster
name: Check RP Presence in RPSaaSMaster

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to .github/workflows/cmd


function usage() {
console.log(`Usage:
npx api-doc-preview --output <output-dir>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to match new name and params

Comment on lines +69 to +72
// Split the path and check if it starts with 'specification'
const pathParts = filePath.split('/');

if (pathParts.length >= 2 && pathParts[0] === 'specification') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We know it must start with specification beacause of the filter you passed to getChangedFiles().

Comment on lines +84 to +90
// Check if reference directory exists
try {
await access(referenceSpecPath);
} catch (error) {
console.error(`Reference specification directory does not exist: ${referenceSpecPath}`);
process.exit(1);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Check if reference directory exists
try {
await access(referenceSpecPath);
} catch (error) {
console.error(`Reference specification directory does not exist: ${referenceSpecPath}`);
process.exit(1);
}

should be sufficient to let FS error bubble and fail app

Comment on lines +95 to +110
const items = await readdir(referenceSpecPath);

// Filter to only directories
referenceRpFolders = [];
for (const item of items) {
const itemPath = join(referenceSpecPath, item);
try {
const stats = await stat(itemPath);
if (stats.isDirectory()) {
referenceRpFolders.push(item);
}
} catch (statError) {
// Skip items we can't stat (permissions, etc.)
console.warn(`Warning: Could not stat ${itemPath}:`, statError.message);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const items = await readdir(referenceSpecPath);
// Filter to only directories
referenceRpFolders = [];
for (const item of items) {
const itemPath = join(referenceSpecPath, item);
try {
const stats = await stat(itemPath);
if (stats.isDirectory()) {
referenceRpFolders.push(item);
}
} catch (statError) {
// Skip items we can't stat (permissions, etc.)
console.warn(`Warning: Could not stat ${itemPath}:`, statError.message);
}
}
const items = await readdir(referenceSpecPath, {withFileTypes:true}).filter(d => d.isDirectory()).map(d => d.name);
referenceRpFolders = new Set(items);

Comment on lines +111 to +114
} catch (error) {
console.error(`Error reading reference directory ${referenceSpecPath}:`, error.message);
process.exit(1);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} catch (error) {
console.error(`Error reading reference directory ${referenceSpecPath}:`, error.message);
process.exit(1);
}
} catch (error) {
console.error(`Error reading reference directory ${referenceSpecPath}:`, error.message);
process.exit(1);
}

sufficient to let exception bubble

Copy link
Member

@mikeharder mikeharder Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to ask if this should be a separate WF, or part of summarize-checks? But it looks like summarize_checks only triggers on WF run, not check run, and we probably don't want to change that? So we need an intermediate WF to bridge the gap with devops?

@@ -55,8 +56,8 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const { default: dumpTriggerMetadata } =
await import('${{ github.workspace }}/.github/workflows/src/summarize-checks/dump-trigger-metadata.js');
const { extractInputs } =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to use consistent names for all 3 related files in this check. How about "RPaaS Branch Validation"?

Comment on lines +41 to +50
- name: "Get Issue Number"
id: get-issue-number
uses: actions/github-script@v7
with:
script: |
const { extractInputs } =
await import('${{ github.workspace }}/.github/workflows/src/context.js');

const { issue_number } = await extractInputs({ github, context, core });
core.setOutput("issue_number", issue_number);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will move this to a shared GH Action after you merge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@mikeharder mikeharder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

Comment on lines +38 to +40
- template: /eng/pipelines/templates/steps/npm-install.yml
parameters:
WorkingDirectory: .github/shared
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- template: /eng/pipelines/templates/steps/npm-install.yml
parameters:
WorkingDirectory: .github/shared
- template: /eng/pipelines/templates/steps/npm-install.yml
parameters:
WorkingDirectory: .github

We could improve perf with a custom install command if needed (npm ci --no-audit --omit dev);. But this might be good enough for a devops pipeline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests. Refactor into exported functions if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🤔 Triage
Development

Successfully merging this pull request may close these issues.

2 participants