Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.issue.number }} --body "A build error occured while merging:
gh pr comment ${{ github.event.issue.number }} --body "A build error occurred while merging:

\`\`\`${{ env.BUILD_LOGS }}
\`\`\`"
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
shell: bash

- name: Commit and push
if: ${{ steps.git-diff.outputs.changed == 'true' && contains(env.BUILD_LOGS, 'successfully updated') }}
if: ${{ steps.git-diff.outputs.changed == 'true' && contains(env.BUILD_LOGS, 'No fatal error found') }}
run: |
git add extensions
git commit -m "Updated extension"
Expand All @@ -114,8 +114,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr comment ${{ github.event.issue.number }} --body "✅ Successfully updated the extension."

- name: Notify build error
if: ${{ steps.git-diff.outputs.changed == 'true' && !contains(env.BUILD_LOGS, 'successfully updated') }}
- name: Notify non-fatal build error
if: ${{ steps.git-diff.outputs.changed == 'true' && contains(env.BUILD_LOGS, 'No fatal error found') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.issue.number }} --body "Extension updated with errors:

\`\`\`${{ env.BUILD_LOGS }}
\`\`\`"

- name: Notify fatal build error
if: ${{ steps.git-diff.outputs.changed == 'true' && !contains(env.BUILD_LOGS, 'successfully updated') && !contains(env.BUILD_LOGS, 'No fatal error found') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
15 changes: 13 additions & 2 deletions scripts/generate-extensions-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ const filterEventsFunctions = (eventsFunctions) =>
const objectShortHeaders = [];

let totalErrors = 0;
let fatalErrors = 0;
let fixableErrors = 0;

const errors = validateNoDuplicates(allExtensionWithFileInfos);
errors.forEach((error) => {
totalErrors++;
fatalErrors++;
shell.echo(`❌ ${error.message}`);
});

Expand All @@ -301,6 +303,7 @@ const filterEventsFunctions = (eventsFunctions) =>
`\n❌ Unable to open extension in file ${extensionWithFileInfo.filename}: ${error.message}\n`
);
totalErrors++;
fatalErrors++;
return;
}

Expand Down Expand Up @@ -482,7 +485,9 @@ const filterEventsFunctions = (eventsFunctions) =>
fixableErrors > 1 ? 's are' : ' is'
} auto-fixable - pass the argument --fix to fix them automatically.`
);
shell.exit(args['disable-exit-code'] ? 0 : 1);
if (fatalErrors) {
shell.exit(args['disable-exit-code'] ? 0 : 1);
}
}

const views = JSON.parse(
Expand Down Expand Up @@ -524,7 +529,13 @@ const filterEventsFunctions = (eventsFunctions) =>
registry
);

console.log(`✅ Headers and registry files successfully updated`);
if (totalErrors) {
console.log(
`No fatal error found the extension can be updated but still need fixes.`
);
} else {
console.log(`✅ Headers and registry files successfully updated`);
}
} catch (error) {
console.error(
`⚠️ Error while generating headers and registry files:`,
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/rules/JavascriptDisallowedProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async function validate({ extension, onError }) {
accumulator +
inspect(current, undefined, undefined, process.env.CI !== 'true') +
'\n',
`Found disallowed properties in extension '${extension.name}':\n`
`JavaScript usage of the extension '${extension.name}' must be checked by the reviewer:\n`
)
// Remove the last \n
.slice(0, -1);
Expand Down