-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
base: main
Are you sure you want to change the base?
Conversation
…aaSRPNotInPrivateRepo variable
Next Steps to Merge✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge. |
PR validation pipeline started successfully. If there is ApiView generated, it will be updated in this comment. |
paths: | ||
include: | ||
# Trigger for files that will result in a specification change | ||
- specification/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: Check RP Presenence in RPSaaSMaster | |
name: Check RP Presence in RPSaaSMaster |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
// Split the path and check if it starts with 'specification' | ||
const pathParts = filePath.split('/'); | ||
|
||
if (pathParts.length >= 2 && pathParts[0] === 'specification') { |
There was a problem hiding this comment.
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().
// Check if reference directory exists | ||
try { | ||
await access(referenceSpecPath); | ||
} catch (error) { | ||
console.error(`Reference specification directory does not exist: ${referenceSpecPath}`); | ||
process.exit(1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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
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); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
} catch (error) { | ||
console.error(`Error reading reference directory ${referenceSpecPath}:`, error.message); | ||
process.exit(1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} 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
There was a problem hiding this comment.
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 } = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug?
There was a problem hiding this comment.
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"?
- 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
- template: /eng/pipelines/templates/steps/npm-install.yml | ||
parameters: | ||
WorkingDirectory: .github/shared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
There was a problem hiding this comment.
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.
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
insummarize-checks
after confirming that the PR:resourcemanager
labelNeed to figure out a good way to test this new PR without merging it.