mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-16 18:13:06 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf3240f1f4 | ||
|
|
084ce47ca6 | ||
|
|
c40923fe8e | ||
|
|
da9b238b9f | ||
|
|
14c01d7c80 | ||
|
|
f5f298b62b | ||
|
|
ca39fc30d8 | ||
|
|
434188b893 | ||
|
|
ac1b820ddc | ||
|
|
5fd37e4e2a | ||
|
|
cff0e333a4 | ||
|
|
2d1764cbc4 | ||
|
|
a70e1873e8 | ||
|
|
702805f039 | ||
|
|
f0de971e8e | ||
|
|
67c3b88b02 | ||
|
|
7af641a0fa | ||
|
|
358cbfeb65 | ||
|
|
c216d5f2b7 | ||
|
|
db930c7ddf | ||
|
|
0c1f6b68b7 | ||
|
|
828f2f9148 | ||
|
|
42aad10c8a | ||
|
|
e0f781420e | ||
|
|
300211eb98 | ||
|
|
53a3b7fd2a | ||
|
|
fe172be0c8 | ||
|
|
db33193a04 | ||
|
|
c99e25c2ca | ||
|
|
7383ddee41 | ||
|
|
4c81265ac9 | ||
|
|
f1f8ac1002 | ||
|
|
1616b803a6 | ||
|
|
8b33263b41 | ||
|
|
dd5bf923ed | ||
|
|
85ddab8e61 | ||
|
|
c249199cc1 | ||
|
|
337241d43a | ||
|
|
cd25b398d9 | ||
|
|
3359c6e0a1 | ||
|
|
b8b921ccff | ||
|
|
80d68add3d | ||
|
|
aa36d2ec23 | ||
|
|
db9bb6e585 | ||
|
|
12564ab63d | ||
|
|
1dffcc969d | ||
|
|
eeecde6c71 | ||
|
|
797305a463 | ||
|
|
f36ff63955 | ||
|
|
8bc8eedf3c | ||
|
|
f09afa599c | ||
|
|
75f00bef1c | ||
|
|
2722a55f0d | ||
|
|
f3d41056d6 | ||
|
|
225d487c34 | ||
|
|
cba5126f34 | ||
|
|
3ee604504f | ||
|
|
6e6bb7b2ec | ||
|
|
50e4c5318e | ||
|
|
aea020a8cd | ||
|
|
db63277c4c | ||
|
|
f87e645e48 | ||
|
|
1a4f93ca27 | ||
|
|
69b396fbea | ||
|
|
90f92f7ae0 | ||
|
|
625bfb30e1 |
@@ -0,0 +1,17 @@
|
||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# For the full list of supported browsers by the Angular framework, please see:
|
||||
# https://angular.io/guide/browser-support
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
last 1 Chrome version
|
||||
last 1 Firefox version
|
||||
last 2 Edge major versions
|
||||
last 2 Safari major version
|
||||
last 2 iOS major versions
|
||||
Firefox ESR
|
||||
not IE 9-11 # For IE 9-11 support, remove 'not'.
|
||||
@@ -0,0 +1,25 @@
|
||||
.git
|
||||
.github
|
||||
.vscode
|
||||
assets
|
||||
coverage
|
||||
docs
|
||||
e2e
|
||||
e2e-output
|
||||
node_modules
|
||||
scripts
|
||||
src
|
||||
lib
|
||||
integration
|
||||
tools
|
||||
demo-shell/src/
|
||||
demo-shell/resources/
|
||||
/angular.json
|
||||
/desktop.ini
|
||||
/cspell.json
|
||||
/CODE_OF_CONDUCT.md
|
||||
/.stylelintignore
|
||||
/ALFRESCOCORS.md
|
||||
/CONTRIBUTING.md
|
||||
/appveyor.yml
|
||||
/BROWSER-SUPPORT.md
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
ignorePatterns: [
|
||||
'projects/**/*',
|
||||
'**/node_modules/**/*',
|
||||
'lib/cli/node_modules/**/*',
|
||||
'**/node_modules',
|
||||
'**/docker',
|
||||
'**/assets',
|
||||
'**/scripts',
|
||||
'**/docs'
|
||||
],
|
||||
plugins: ['@nrwl/nx'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts'],
|
||||
parserOptions: {
|
||||
project: ['tsconfig.json', 'e2e/tsconfig.e2e.json'],
|
||||
createDefaultProgram: true
|
||||
},
|
||||
extends: [
|
||||
'plugin:@nrwl/nx/typescript',
|
||||
'plugin:@nrwl/nx/angular',
|
||||
'plugin:@cspell/recommended',
|
||||
'plugin:@angular-eslint/ng-cli-compat',
|
||||
'plugin:@angular-eslint/ng-cli-compat--formatting-add-on',
|
||||
'plugin:@angular-eslint/template/process-inline-templates',
|
||||
'plugin:jsdoc/recommended-typescript-error'
|
||||
],
|
||||
plugins: [
|
||||
'eslint-plugin-unicorn',
|
||||
'eslint-plugin-rxjs',
|
||||
'prettier',
|
||||
'ban',
|
||||
'license-header',
|
||||
'@cspell',
|
||||
'eslint-plugin-import',
|
||||
'@angular-eslint/eslint-plugin',
|
||||
'@typescript-eslint',
|
||||
'jsdoc'
|
||||
],
|
||||
rules: {
|
||||
// Uncomment this to enable prettier checks as part of the ESLint
|
||||
// 'prettier/prettier': 'error',
|
||||
'ban/ban': [
|
||||
'error',
|
||||
{ name: 'eval', message: 'Calls to eval is not allowed.' },
|
||||
{ name: 'fdescribe', message: 'Calls to fdescribe is not allowed' },
|
||||
{ name: 'fit', message: 'Calls to fit is not allowed' },
|
||||
{ name: 'xit', message: 'Calls to xit is not allowed' },
|
||||
{ name: 'xdescribe', message: 'Calls to xdescribe is not allowed' },
|
||||
{ name: ['test', 'only'], message: 'Calls to test.only is not allowed' },
|
||||
{ name: ['describe', 'only'], message: 'Calls to describe.only is not allowed' }
|
||||
],
|
||||
'@angular-eslint/component-selector': [
|
||||
'error',
|
||||
{
|
||||
type: 'element',
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/directive-selector': [
|
||||
'error',
|
||||
{
|
||||
type: ['element', 'attribute'],
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/no-host-metadata-property': 'off',
|
||||
'@angular-eslint/no-input-prefix': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'off',
|
||||
{
|
||||
accessibility: 'explicit'
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/prefer-optional-chain': 'warn',
|
||||
'@typescript-eslint/no-inferrable-types': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'error',
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: [
|
||||
'classProperty',
|
||||
'objectLiteralProperty',
|
||||
'typeProperty',
|
||||
'classMethod',
|
||||
'objectLiteralMethod',
|
||||
'typeMethod',
|
||||
'accessor',
|
||||
'enumMember'
|
||||
],
|
||||
format: null,
|
||||
modifiers: ['requiresQuotes']
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/member-ordering': 'off',
|
||||
'prefer-arrow/prefer-arrow-functions': 'off',
|
||||
|
||||
'brace-style': 'off',
|
||||
'@typescript-eslint/brace-style': 'error',
|
||||
'comma-dangle': 'error',
|
||||
'default-case': 'error',
|
||||
'import/order': 'off',
|
||||
'max-len': [
|
||||
'error',
|
||||
{
|
||||
code: 240
|
||||
}
|
||||
],
|
||||
'no-bitwise': 'off',
|
||||
'no-console': [
|
||||
'error',
|
||||
{
|
||||
allow: [
|
||||
'warn',
|
||||
'dir',
|
||||
'timeLog',
|
||||
'assert',
|
||||
'clear',
|
||||
'count',
|
||||
'countReset',
|
||||
'group',
|
||||
'groupEnd',
|
||||
'table',
|
||||
'dirxml',
|
||||
'error',
|
||||
'groupCollapsed',
|
||||
'Console',
|
||||
'profile',
|
||||
'profileEnd',
|
||||
'timeStamp',
|
||||
'context'
|
||||
]
|
||||
}
|
||||
],
|
||||
'no-duplicate-imports': 'error',
|
||||
'no-multiple-empty-lines': 'error',
|
||||
'no-redeclare': 'error',
|
||||
'no-return-await': 'error',
|
||||
'rxjs/no-create': 'error',
|
||||
'rxjs/no-subject-unsubscribe': 'error',
|
||||
'rxjs/no-subject-value': 'error',
|
||||
'rxjs/no-unsafe-takeuntil': 'error',
|
||||
'unicorn/filename-case': 'error',
|
||||
'@typescript-eslint/no-unused-expressions': [
|
||||
'error',
|
||||
{
|
||||
allowShortCircuit: true,
|
||||
allowTernary: true
|
||||
}
|
||||
],
|
||||
'license-header/header': [
|
||||
'error',
|
||||
[
|
||||
'/*!',
|
||||
' * @license',
|
||||
' * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.',
|
||||
' *',
|
||||
' * Licensed under the Apache License, Version 2.0 (the "License");',
|
||||
' * you may not use this file except in compliance with the License.',
|
||||
' * You may obtain a copy of the License at',
|
||||
' *',
|
||||
' * http://www.apache.org/licenses/LICENSE-2.0',
|
||||
' *',
|
||||
' * Unless required by applicable law or agreed to in writing, software',
|
||||
' * distributed under the License is distributed on an "AS IS" BASIS,',
|
||||
' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.',
|
||||
' * See the License for the specific language governing permissions and',
|
||||
' * limitations under the License.',
|
||||
' */'
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.html'],
|
||||
extends: ['plugin:@angular-eslint/template/recommended'],
|
||||
rules: {}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
.github/workflows/*.lock.yml linguist-generated=true merge=ours
|
||||
+3
-3
@@ -4,15 +4,15 @@
|
||||
# the repo. Unless a later match takes precedence,
|
||||
# these users will be requested for
|
||||
# review when someone opens a pull request.
|
||||
* @eromano
|
||||
* @eromano @popovicsandras @DenysVuika
|
||||
|
||||
# Order is important; the last matching pattern takes the most
|
||||
# precedence. When someone opens a pull request that only
|
||||
# modifies JS files, only @js-owner and not the global
|
||||
# owner(s) will be requested for a review.
|
||||
/e2e/ @eromano
|
||||
/e2e/ @eromano @cristinaj
|
||||
|
||||
# The `docs/*` pattern will match files like
|
||||
# `docs/getting-started.md` but not further nested files like
|
||||
# `docs/build-app/troubleshooting.md`.
|
||||
/docs/ @eromano
|
||||
/docs/ @m-hulbert @eromano
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
name: Append content to Artifact
|
||||
description: 'Allow the user to append content to an existing artifact'
|
||||
|
||||
inputs:
|
||||
artifact-name:
|
||||
description: 'The name of the artifact'
|
||||
required: true
|
||||
type: string
|
||||
file-name:
|
||||
description: 'The name of the file with extension created in the artifact'
|
||||
required: true
|
||||
type: string
|
||||
content:
|
||||
description: 'The content to append'
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- run: echo "Artifact Append"
|
||||
shell: bash
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
- run: ls
|
||||
shell: bash
|
||||
- name: Append content
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
contentFile: ${{ inputs.content }}
|
||||
fileName: ${{ inputs.file-name }}
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
|
||||
const affectedLib = process.env.contentFile;
|
||||
const fileName = process.env.fileName;
|
||||
core.info(`Input Filename: ${fileName}`);
|
||||
core.info(`Input content: ${affectedLib}`);
|
||||
|
||||
const content = read(fileName)
|
||||
core.info(`File content: ${content}`);
|
||||
appendContent(content, affectedLib);
|
||||
|
||||
function read(filename) {
|
||||
try {
|
||||
const contentFile = fs.readFileSync(filename, 'utf8').replace('\n','');
|
||||
return contentFile;
|
||||
} catch (err) {
|
||||
core.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
function write(filename, content) {
|
||||
try {
|
||||
fs.writeFileSync(filename, content);
|
||||
} catch (err) {
|
||||
core.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
function appendContent(content, append) {
|
||||
let changedContent;
|
||||
const libs = content.split(' ');
|
||||
if (libs?.length>0) {
|
||||
if (libs.length === 1 && libs[0] === '') {
|
||||
libs[0] = append;
|
||||
changedContent = libs[0];
|
||||
}
|
||||
else if (!libs.includes(append)) {
|
||||
libs.push(append);
|
||||
changedContent = libs.join(' ');
|
||||
} else {
|
||||
core.info(`Lib ${append} already affected`);
|
||||
}
|
||||
}
|
||||
if (changedContent != undefined){
|
||||
core.info(`File content append: ${changedContent}`)
|
||||
write(fileName, changedContent);
|
||||
}
|
||||
}
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: ${{ inputs.file-name }}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
name: Extract Artifact
|
||||
description: 'Allow the user to extract content from an artifact'
|
||||
|
||||
inputs:
|
||||
artifact-name:
|
||||
description: 'The name of the artifact'
|
||||
required: true
|
||||
type: string
|
||||
file-name:
|
||||
description: 'The name of the file with extension created in the artifact'
|
||||
required: true
|
||||
type: string
|
||||
content:
|
||||
description: 'The init content the file should have'
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
outputs:
|
||||
result:
|
||||
description: "the value extrated from the file inside the artifact"
|
||||
value: ${{ steps.extract.outputs.result }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: echo "Artifact Extract"
|
||||
shell: bash
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
- id: extract
|
||||
shell: bash
|
||||
run: |
|
||||
value=`cat ${{ inputs.file-name }}`
|
||||
echo "print $value"
|
||||
echo "result=$value" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Initialize Artifact
|
||||
description: 'Allow the user to initialize an empty artifact used globally'
|
||||
|
||||
inputs:
|
||||
artifact-name:
|
||||
description: 'The name of the artifact'
|
||||
required: true
|
||||
type: string
|
||||
file-name:
|
||||
description: 'The name of the file with extension created in the artifact'
|
||||
required: true
|
||||
type: string
|
||||
content:
|
||||
description: 'The init content the file should have'
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Create empty artifact
|
||||
shell: bash
|
||||
run:
|
||||
echo "${{inputs.content}}" > ${{ inputs.file-name }}
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: ${{ inputs.file-name }}
|
||||
@@ -9,17 +9,18 @@ inputs:
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Before install
|
||||
if: ${{ ! env.ACT }}
|
||||
shell: bash
|
||||
run: |
|
||||
pip install --user --quiet awscli
|
||||
|
||||
- name: base vars
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${GITHUB_BASE_REF:-}" ]; then
|
||||
BASE_HASH=$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD 2>/dev/null || git rev-parse HEAD)
|
||||
else
|
||||
BASE_HASH=$(git rev-parse HEAD)
|
||||
fi
|
||||
{
|
||||
echo "GIT_HASH=$(git rev-parse HEAD)";
|
||||
echo "BASE_HASH=${BASE_HASH}";
|
||||
echo "BASE_HASH=$(git merge-base origin/${GITHUB_BASE_REF} HEAD)";
|
||||
echo "HEAD_HASH=HEAD";
|
||||
echo "HEAD_COMMIT_HASH=${GH_COMMIT}";
|
||||
echo "NX_CALCULATION_FLAGS=--all";
|
||||
@@ -30,22 +31,10 @@ runs:
|
||||
|
||||
- name: affected:* flag parser
|
||||
shell: bash
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
if: ${{ contains(github.event.head_commit.message , '[affected:*]') }}
|
||||
run: |
|
||||
# Get commit message safely from git to avoid script injection
|
||||
# For PRs, use the PR head SHA; for other events use HEAD
|
||||
if [ "$EVENT_NAME" == "pull_request" ] && [ -n "$PR_HEAD_SHA" ]; then
|
||||
COMMIT_MSG=$(git log -1 --format=%B "$PR_HEAD_SHA" 2>/dev/null || echo "")
|
||||
else
|
||||
COMMIT_MSG=$(git log -1 --format=%B 2>/dev/null || echo "")
|
||||
fi
|
||||
|
||||
if echo "$COMMIT_MSG" | grep -qF "[affected:*]"; then
|
||||
echo "Setting up CI to run with commit flag [affected:*] flag."
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
fi
|
||||
echo "Setting up CI to run with commit flag [affected:*] flag."
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
|
||||
- name: PULL_REQUEST event
|
||||
if: ${{ env.BREAK_ACTION == false && github.event_name == 'pull_request' && !github.event.pull_request.merged }}
|
||||
@@ -60,22 +49,19 @@ runs:
|
||||
} >> $GITHUB_ENV
|
||||
|
||||
- name: RELEASE on master/develop patch branch
|
||||
if: ${{ env.BREAK_ACTION == false && (github.event.pull_request.merged || github.event_name == 'push') }}
|
||||
if: ${{ env.BREAK_ACTION == false && github.event.pull_request.merged }}
|
||||
shell: bash
|
||||
env:
|
||||
REF_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
if [[ "$REF_NAME" =~ ^master(-patch.*)?$ ]]; then
|
||||
if [[ "${{ github.ref_name }}" =~ ^master(-patch.*)?$ ]]; then
|
||||
# into master(-patch*)
|
||||
echo "Setting up CI flags for Push on master patch"
|
||||
elif [[ "$REF_NAME" =~ ^develop-patch.*$ ]]; then
|
||||
elif [[ "${{ github.ref_name }}" =~ ^develop-patch.*$ ]]; then
|
||||
# into develop-patch*
|
||||
echo "Setting up CI flags for Push develop patch"
|
||||
else
|
||||
echo "Setting up CI flags for Push on develop branch"
|
||||
# base=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
# we publish always all the libs until we don't handle partial release
|
||||
echo "NX_CALCULATION_FLAGS=--all" >> $GITHUB_ENV
|
||||
base=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
echo "NX_CALCULATION_FLAGS=--base=$base --head=$HEAD_HASH" >> $GITHUB_ENV
|
||||
fi
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
name: Git tag creation
|
||||
description: 'Creates a git tag in the specified repository for a given commit.'
|
||||
|
||||
inputs:
|
||||
tagName:
|
||||
description: 'The github tag to be created'
|
||||
required: true
|
||||
releaseNote:
|
||||
description: 'The github release note to be created'
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
name: Create git tag
|
||||
env:
|
||||
TAG_NAME: ${{ inputs.tagName }}
|
||||
RELEASE_NOTE: ${{ inputs.releaseNote }}
|
||||
with:
|
||||
script: |
|
||||
const createGitTag = require('./.github/actions/create-git-tag/create-git-tag.js');
|
||||
await createGitTag({ core, github, context, tagName: process.env.TAG_NAME });
|
||||
@@ -1,42 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports = async ({ github, context, core, tagName }) => {
|
||||
const tagSHA = context.payload?.after ?? context.sha;
|
||||
|
||||
core.notice(`Creating tag with title: ${tagName}, and SHA: ${tagSHA}`);
|
||||
|
||||
const createdTag = await github.rest.git.createTag({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag: tagName,
|
||||
message: 'Release note',
|
||||
object: tagSHA,
|
||||
type: 'commit'
|
||||
});
|
||||
|
||||
const createdRef = await github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/tags/' + tagName,
|
||||
sha: createdTag.data.sha
|
||||
});
|
||||
|
||||
if (createdRef.status === 201) {
|
||||
core.notice(`Tag ${tagName} was created successfully`);
|
||||
}
|
||||
};
|
||||
@@ -3,33 +3,17 @@ description: "Download build artifacts"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Restore dist from cache
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: dist
|
||||
key: dist-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
dist-${{ github.run_id }}-
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: Restore nxcache from cache
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: nxcache
|
||||
key: nxcache-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
nxcache-${{ github.run_id }}-
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: Restore node_modules from cache
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
node-modules-${{ github.run_id }}-
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: download and extract artifacts from s3
|
||||
shell: bash
|
||||
env:
|
||||
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
||||
run: |
|
||||
packages=( dist nxcache node_modules )
|
||||
for i in "${packages[@]}"; do
|
||||
time aws s3 cp --no-progress s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz $i.tar.gz
|
||||
du -h $i.tar.gz
|
||||
time tar xzf $i.tar.gz
|
||||
done
|
||||
- name: show files
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -40,4 +24,4 @@ runs:
|
||||
echo "====NXCACHE===="
|
||||
find nxcache -maxdepth 1 -type d
|
||||
echo "====ADF===="
|
||||
find node_modules/@alfresco/ -maxdepth 1 -type d
|
||||
find node_modules/@alfresco/ -maxdepth 1 -type d
|
||||
@@ -0,0 +1,200 @@
|
||||
name: "e2e"
|
||||
description: "e2e"
|
||||
inputs:
|
||||
e2e-test-id:
|
||||
description: "Test id"
|
||||
required: true
|
||||
e2e-test-folder:
|
||||
description: "Test folder"
|
||||
required: true
|
||||
e2e-test-provider:
|
||||
description: "Test provider"
|
||||
required: true
|
||||
e2e-test-auth:
|
||||
description: "Test auth"
|
||||
required: true
|
||||
output:
|
||||
description: "Output path"
|
||||
required: true
|
||||
check-cs-env:
|
||||
required: true
|
||||
description: check cs env
|
||||
default: "false"
|
||||
check-ps-env:
|
||||
required: true
|
||||
description: check ps env
|
||||
default: "false"
|
||||
check-external-cs-env:
|
||||
required: true
|
||||
description: check external cs env
|
||||
default: "false"
|
||||
check-ps-cloud-env:
|
||||
required: true
|
||||
description: check ps cloud env
|
||||
default: "false"
|
||||
e2e-tar-name: #
|
||||
required: false
|
||||
default: e2e.tar.gz
|
||||
apa-proxy: #
|
||||
description: "proxy host"
|
||||
required: true
|
||||
deps:
|
||||
description: "Library dependencies"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Determine if affected
|
||||
shell: bash
|
||||
id: determine-affected
|
||||
run: |
|
||||
isAffected=false
|
||||
affectedLibs=$(npx nx print-affected --type=lib --select=projects ${NX_CALCULATION_FLAGS} --plain)
|
||||
if [[ $affectedLibs =~ "${{ inputs.e2e-test-id }}" ]]; then
|
||||
isAffected=true
|
||||
fi;
|
||||
echo "Determine if ${{ inputs.e2e-test-id }} is affected: $isAffected";
|
||||
echo "isAffected=$isAffected" >> $GITHUB_OUTPUT
|
||||
- name: print value
|
||||
shell: bash
|
||||
run: |
|
||||
echo "value: ${{ steps.determine-affected.outputs.isAffected }}"
|
||||
- name: use APA as PROXY host if apa-proxy is set
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ -n "${{ inputs.apa-proxy }}" ]]; then
|
||||
echo "APA proxy set."
|
||||
echo "PROXY_HOST_BPM=${E2E_HOST_APA}" >> $GITHUB_ENV
|
||||
echo "PROXY_HOST_ECM=${E2E_IDENTITY_HOST_APA}" >> $GITHUB_ENV
|
||||
echo "HOST_SSO=${E2E_IDENTITY_HOST_APA}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: install aws cli
|
||||
shell: bash
|
||||
run: pip install awscli
|
||||
- name: download smartrunner test results from s3 bucket if they exist
|
||||
shell: bash
|
||||
env:
|
||||
REMOTE_PATH: smart-runner/${{ github.run_id}}/${{ inputs.e2e-test-folder }}-${{ inputs.e2e-test-id}}/e2e.tar.gz
|
||||
run: |
|
||||
set -u;
|
||||
mkdir -p "${SMART_RUNNER_PATH}"
|
||||
if [[ $(aws s3 ls "s3://${S3_BUILD_BUCKET_SHORT_NAME}/adf/${REMOTE_PATH}" > /dev/null; echo $?) -eq 0 ]]; then
|
||||
echo "downloading test files"
|
||||
aws s3 cp "s3://${S3_BUILD_BUCKET_SHORT_NAME}/adf/${REMOTE_PATH}" .;
|
||||
tar xzf ${{ inputs.e2e-tar-name }};
|
||||
else
|
||||
echo "nothing to download";
|
||||
fi
|
||||
|
||||
- name: check EXTERNAL-CS is UP
|
||||
shell: bash
|
||||
if: ${{ inputs.check-external-cs-env == 'true' && steps.determine-affected.outputs.isAffected == 'true' }}
|
||||
run: |
|
||||
echo "running: check EXTERNAL-CS is UP"
|
||||
set -u;
|
||||
./node_modules/@alfresco/adf-cli/bin/adf-cli \
|
||||
check-cs-env \
|
||||
--host "$EXTERNAL_ACS_HOST" \
|
||||
-u "$E2E_USERNAME" \
|
||||
-p "$E2E_PASSWORD" || exit 1
|
||||
|
||||
- name: Check CS is UP
|
||||
shell: bash
|
||||
if: ${{ inputs.check-cs-env == 'true' && steps.determine-affected.outputs.isAffected == 'true' }}
|
||||
run: |
|
||||
echo "Running: Check CS is UP"
|
||||
set -u;
|
||||
./node_modules/@alfresco/adf-cli/bin/adf-cli \
|
||||
check-cs-env \
|
||||
--host "$E2E_HOST" \
|
||||
-u "$E2E_USERNAME" \
|
||||
-p "$E2E_PASSWORD" || exit 1
|
||||
|
||||
- name: check PS is UP
|
||||
shell: bash
|
||||
if: ${{ inputs.check-ps-env == 'true' && steps.determine-affected.outputs.isAffected == 'true' }}
|
||||
run: |
|
||||
echo "Running: check PS is UP"
|
||||
set -u;
|
||||
./node_modules/@alfresco/adf-cli/bin/adf-cli init-aps-env \
|
||||
--host "$E2E_HOST" \
|
||||
-u "$E2E_USERNAME" \
|
||||
-p "$E2E_PASSWORD" \
|
||||
--license "$AWS_S3_BUCKET_ACTIVITI_LICENSE" || exit 1
|
||||
|
||||
- name: check PS-CLOUD is UP
|
||||
shell: bash
|
||||
if: ${{ inputs.check-ps-cloud-env == 'true' && steps.determine-affected.outputs.isAffected == 'true' }}
|
||||
run: |
|
||||
echo "running: check PS-CLOUD is UP"
|
||||
set -u;
|
||||
./node_modules/@alfresco/adf-cli/bin/adf-cli init-aae-env \
|
||||
--oauth "$E2E_IDENTITY_HOST_APA" \
|
||||
--host "$E2E_HOST_APA" \
|
||||
--modelerUsername "$E2E_MODELER_USERNAME" \
|
||||
--modelerPassword "$E2E_MODELER_PASSWORD" \
|
||||
--devopsUsername "$E2E_DEVOPS_USERNAME" \
|
||||
--devopsPassword "$E2E_DEVOPS_PASSWORD" \
|
||||
--clientId 'alfresco' || exit 1
|
||||
|
||||
- name: variables sanitization
|
||||
env:
|
||||
FOLDER: "${{ inputs.e2e-test-folder }}"
|
||||
PROVIDER: "${{ inputs.e2e-test-provider }}"
|
||||
AUTH_TYPE: "${{ inputs.e2e-test-auth }}"
|
||||
E2E_TEST_ID: "${{ inputs.e2e-test-id }}"
|
||||
DEPS: "${{ inputs.deps }}"
|
||||
shell: bash
|
||||
run: |
|
||||
set -u;
|
||||
echo $PROXY_HOST_BPM
|
||||
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
|
||||
|
||||
- name: run test
|
||||
id: e2e_run
|
||||
if: ${{ steps.determine-affected.outputs.isAffected == 'true' }}
|
||||
env:
|
||||
FOLDER: "${{ inputs.e2e-test-folder }}"
|
||||
PROVIDER: "${{ inputs.e2e-test-provider }}"
|
||||
AUTH_TYPE: "${{ inputs.e2e-test-auth }}"
|
||||
E2E_TEST_ID: "${{ inputs.e2e-test-id }}"
|
||||
DEPS: "${{ inputs.deps }}"
|
||||
shell: bash
|
||||
run: |
|
||||
set -u;
|
||||
if [[ ${{ inputs.e2e-test-folder }} == 'content-services/upload' ]]; then
|
||||
export DISPLAY=:99
|
||||
chromedriver --url-base=/wd/hub &
|
||||
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
|
||||
bash ./scripts/github/e2e/e2e.sh "$E2E_TEST_ID" "$DEPS" "browser" || exit 1
|
||||
else
|
||||
bash ./scripts/github/e2e/e2e.sh "$E2E_TEST_ID" "$DEPS" || exit 1
|
||||
fi
|
||||
- name: Trace failing e2e
|
||||
if: ${{ steps.determine-affected.outputs.isAffected == 'true' && github.event_name == 'schedule' && failure() }}
|
||||
uses: ./.github/actions/artifact-append
|
||||
with:
|
||||
artifact-name: global-e2e-result
|
||||
file-name: e2e-failures.txt
|
||||
content: "${{ inputs.e2e-test-id }}"
|
||||
|
||||
- name: upload artifacts on gh
|
||||
id: upload_gh
|
||||
if: ${{ steps.determine-affected.outputs.isAffected == 'true' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: e2e-artifact-output
|
||||
path: /home/runner/work/alfresco-ng2-components/alfresco-ng2-components/e2e-output-*
|
||||
|
||||
- name: upload smart-runner tests results on s3 to cache tests
|
||||
shell: bash
|
||||
if: always()
|
||||
env:
|
||||
REMOTE_PATH: "smart-runner/${{ github.run_id}}/${{ inputs.e2e-test-folder }}-${{ inputs.e2e-test-id}}/e2e.tar.gz"
|
||||
# description: always upload newer results
|
||||
run: |
|
||||
tar czf "${{ inputs.e2e-tar-name }}" "${SMART_RUNNER_PATH}"
|
||||
aws s3 cp "${{ inputs.e2e-tar-name }}" "s3://${S3_BUILD_BUCKET_SHORT_NAME}/adf/${REMOTE_PATH}"
|
||||
@@ -20,11 +20,9 @@ runs:
|
||||
- name: set dryrun flag to TRUE
|
||||
shell: bash
|
||||
id: dryrun
|
||||
env:
|
||||
DRY_RUN_FLAG: ${{ inputs.dry-run-flag }}
|
||||
run: |
|
||||
if [[ "$DRY_RUN_FLAG" == 'true' ]]; then
|
||||
echo "dryrun=--dry-run" >> $GITHUB_OUTPUT;
|
||||
if [[ '${{ inputs.dry-run-flag }}' == 'true' ]]; then
|
||||
echo "dryrun=--dryrun" >> $GITHUB_OUTPUT;
|
||||
echo "enabling dryrun"
|
||||
else
|
||||
echo "dryrun=" >> $GITHUB_OUTPUT;
|
||||
|
||||
@@ -5,45 +5,24 @@ inputs:
|
||||
branch_name:
|
||||
description: "override GITHUB_REF_NAME"
|
||||
required: false
|
||||
default: ${{ github.ref_name }}
|
||||
default: $GITHUB_REF_NAME
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: load "NPM TAG"
|
||||
id: set-npm-tag
|
||||
uses: ./.github/actions/set-npm-tag
|
||||
with:
|
||||
branch_name: ${{ inputs.branch_name }}
|
||||
- name: check npm bundle
|
||||
shell: bash
|
||||
id: sha_out
|
||||
env:
|
||||
TAG_NPM: ${{ steps.set-npm-tag.outputs.npm-tag }}
|
||||
run: |
|
||||
if [[ -z $TAG_NPM ]]; then
|
||||
echo "TAG_NPM not set, aborting"
|
||||
exit 1
|
||||
echo "TAG_NPM not set, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Retry to absorb npm registry propagation delay right after publish.
|
||||
NPM_VIEW_RETRIES=24
|
||||
NPM_VIEW_RETRY_DELAY=20
|
||||
for attempt in $(seq 1 "$NPM_VIEW_RETRIES"); do
|
||||
ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version 2>/dev/null) || true
|
||||
if [[ -n $ADF_VERSION ]]; then
|
||||
break
|
||||
fi
|
||||
if [[ $attempt -lt $NPM_VIEW_RETRIES ]]; then
|
||||
sleep "$NPM_VIEW_RETRY_DELAY"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $ADF_VERSION ]]; then
|
||||
echo "Could not resolve @alfresco/adf-core@${TAG_NPM} version, aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
|
||||
echo "check bundle on TAG_NPM='${TAG_NPM}' and ADF_VERSION='${ADF_VERSION}'"
|
||||
./scripts/github/build/npm-check-bundles.sh -v ${ADF_VERSION}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
name: "print affected libs"
|
||||
description: "Retrive the affected libs based on the based and head input"
|
||||
inputs:
|
||||
base:
|
||||
description: 'the base sha'
|
||||
required: true
|
||||
type: string
|
||||
default: main
|
||||
head:
|
||||
description: 'the head sha'
|
||||
required: true
|
||||
type: string
|
||||
default: HEAD
|
||||
output:
|
||||
affected:
|
||||
description: 'the affected libs of the repo'
|
||||
affected_is_empty:
|
||||
description: 'true or false accondingly'
|
||||
runs:
|
||||
using: "node16"
|
||||
main: 'dist/index.js'
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+476
@@ -0,0 +1,476 @@
|
||||
{
|
||||
"name": "print-affected-libs",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "print-affected-libs",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "^0.36.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||
"dependencies": {
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/exec": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
|
||||
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
|
||||
"dependencies": {
|
||||
"@actions/io": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
|
||||
"integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
|
||||
"dependencies": {
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"@octokit/core": "^3.6.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/http-client": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
||||
"dependencies": {
|
||||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/io": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
||||
},
|
||||
"node_modules/@octokit/auth-token": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
|
||||
"integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/core": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
|
||||
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
|
||||
"dependencies": {
|
||||
"@octokit/auth-token": "^2.4.4",
|
||||
"@octokit/graphql": "^4.5.8",
|
||||
"@octokit/request": "^5.6.3",
|
||||
"@octokit/request-error": "^2.0.5",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"before-after-hook": "^2.2.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/endpoint": {
|
||||
"version": "6.0.12",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz",
|
||||
"integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.0.3",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/graphql": {
|
||||
"version": "4.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz",
|
||||
"integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==",
|
||||
"dependencies": {
|
||||
"@octokit/request": "^5.6.0",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/openapi-types": {
|
||||
"version": "12.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz",
|
||||
"integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ=="
|
||||
},
|
||||
"node_modules/@octokit/plugin-paginate-rest": {
|
||||
"version": "2.21.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz",
|
||||
"integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.40.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": ">=2"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "5.16.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz",
|
||||
"integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.39.0",
|
||||
"deprecation": "^2.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": ">=3"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request": {
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
|
||||
"integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": "^6.0.1",
|
||||
"@octokit/request-error": "^2.1.0",
|
||||
"@octokit/types": "^6.16.1",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request-error": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
|
||||
"integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.0.3",
|
||||
"deprecation": "^2.0.0",
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/types": {
|
||||
"version": "6.41.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz",
|
||||
"integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^12.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vercel/ncc": {
|
||||
"version": "0.36.1",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz",
|
||||
"integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"ncc": "dist/ncc/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/before-after-hook": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
|
||||
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
|
||||
},
|
||||
"node_modules/deprecation": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
|
||||
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
|
||||
},
|
||||
"node_modules/is-plain-object": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.11",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
|
||||
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"node_modules/tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
||||
"engines": {
|
||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||
}
|
||||
},
|
||||
"node_modules/universal-user-agent": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||
"requires": {
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"@actions/exec": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
|
||||
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
|
||||
"requires": {
|
||||
"@actions/io": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"@actions/github": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
|
||||
"integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
|
||||
"requires": {
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"@octokit/core": "^3.6.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
|
||||
}
|
||||
},
|
||||
"@actions/http-client": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
||||
"requires": {
|
||||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"@actions/io": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
||||
},
|
||||
"@octokit/auth-token": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
|
||||
"integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.3"
|
||||
}
|
||||
},
|
||||
"@octokit/core": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
|
||||
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
|
||||
"requires": {
|
||||
"@octokit/auth-token": "^2.4.4",
|
||||
"@octokit/graphql": "^4.5.8",
|
||||
"@octokit/request": "^5.6.3",
|
||||
"@octokit/request-error": "^2.0.5",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"before-after-hook": "^2.2.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/endpoint": {
|
||||
"version": "6.0.12",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz",
|
||||
"integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.3",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/graphql": {
|
||||
"version": "4.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz",
|
||||
"integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==",
|
||||
"requires": {
|
||||
"@octokit/request": "^5.6.0",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/openapi-types": {
|
||||
"version": "12.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz",
|
||||
"integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ=="
|
||||
},
|
||||
"@octokit/plugin-paginate-rest": {
|
||||
"version": "2.21.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz",
|
||||
"integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.40.0"
|
||||
}
|
||||
},
|
||||
"@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "5.16.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz",
|
||||
"integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.39.0",
|
||||
"deprecation": "^2.3.1"
|
||||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
|
||||
"integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
|
||||
"requires": {
|
||||
"@octokit/endpoint": "^6.0.1",
|
||||
"@octokit/request-error": "^2.1.0",
|
||||
"@octokit/types": "^6.16.1",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/request-error": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
|
||||
"integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.3",
|
||||
"deprecation": "^2.0.0",
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"@octokit/types": {
|
||||
"version": "6.41.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz",
|
||||
"integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==",
|
||||
"requires": {
|
||||
"@octokit/openapi-types": "^12.11.0"
|
||||
}
|
||||
},
|
||||
"@vercel/ncc": {
|
||||
"version": "0.36.1",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz",
|
||||
"integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==",
|
||||
"dev": true
|
||||
},
|
||||
"before-after-hook": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
|
||||
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
|
||||
},
|
||||
"deprecation": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
|
||||
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
|
||||
},
|
||||
"is-plain-object": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.11",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
|
||||
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "print-affected-libs",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "ncc build src/index.js -o dist --source-map"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "^0.36.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
const core = require('@actions/core');
|
||||
const exec = require('@actions/exec');
|
||||
|
||||
async function run() {
|
||||
const base = core.getInput('base', {required: false }) || '5288597580';
|
||||
core.setOutput('affected_is_empty', 'true');
|
||||
|
||||
let affected = '';
|
||||
let myError = '';
|
||||
|
||||
const options = {};
|
||||
options.listeners = {
|
||||
stdout: (data) => {
|
||||
affected += data.toString()
|
||||
},
|
||||
stderr: (data) => {
|
||||
myError += data.toString();
|
||||
}
|
||||
};
|
||||
|
||||
await exec.exec(`npx nx print-affected --target=build --select=tasks.target.project --base=${base} --head=${head}`, [], options)
|
||||
|
||||
const affectedTrimmed = affected.trim();
|
||||
if (affectedTrimmed !== '') {
|
||||
core.setOutput('affected_is_empty', 'false');
|
||||
}
|
||||
core.notice(`Retriving affected libs: ${affectedTrimmed}`);
|
||||
|
||||
core.setOutput('affected', affectedTrimmed);
|
||||
}
|
||||
|
||||
run();
|
||||
@@ -1,17 +0,0 @@
|
||||
name: 'Save Nx Cache'
|
||||
description: 'Save Nx cache and dist outputs only when the job succeeds'
|
||||
inputs:
|
||||
cache-suffix:
|
||||
description: 'Must match the cache-suffix used in the setup action'
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Save nx cache
|
||||
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: |
|
||||
nxcache
|
||||
.nx
|
||||
dist
|
||||
key: ${{ runner.os }}-nxcache-${{ inputs.cache-suffix }}-${{ hashFiles('nx.json') }}-${{ github.sha }}
|
||||
@@ -2,44 +2,36 @@ name: "set npm tag"
|
||||
description: "se NPM tag"
|
||||
|
||||
inputs:
|
||||
event_name:
|
||||
description: "override github.event_name"
|
||||
required: false
|
||||
default: ${{ github.event_name }}
|
||||
branch_name:
|
||||
description: "override GITHUB_REF_NAME"
|
||||
required: false
|
||||
default: ${{ github.ref_name }}
|
||||
|
||||
outputs:
|
||||
npm-tag:
|
||||
description: "NPM tag"
|
||||
value: ${{ steps.set-npm-tag.outputs.npm-tag }}
|
||||
default: $GITHUB_REF_NAME
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- name: set TAG_NPM
|
||||
id: set-npm-tag
|
||||
shell: bash
|
||||
env:
|
||||
BRANCH_NAME: ${{ inputs.branch_name }}
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
||||
TAG_NPM="branch"
|
||||
else
|
||||
TAG_NPM="alpha"
|
||||
VERSION_IN_PACKAGE_JSON=$(node -p "require('./package.json')".version)
|
||||
echo "version in package.json=${VERSION_IN_PACKAGE_JSON}"
|
||||
if [[ $BRANCH_NAME =~ ^master(-patch.*)?$ ]]; then
|
||||
# Pre-release versions
|
||||
if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]]; then
|
||||
TAG_NPM=next
|
||||
# Stable major versions
|
||||
else
|
||||
TAG_NPM=latest
|
||||
fi
|
||||
fi
|
||||
if [[ $BRANCH_NAME =~ ^develop(-patch.*)?$ ]]; then
|
||||
TAG_NPM=alpha
|
||||
fi
|
||||
TAG_NPM="alpha"
|
||||
VERSION_IN_PACKAGE_JSON=$(node -p "require('./package.json')".version)
|
||||
echo "version in package.json=${VERSION_IN_PACKAGE_JSON}"
|
||||
if [[ ${{ inputs.branch_name }} =~ ^master(-patch.*)?$ ]]; then
|
||||
# Pre-release versions
|
||||
if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]];
|
||||
then
|
||||
TAG_NPM=next
|
||||
# Stable major versions
|
||||
else
|
||||
TAG_NPM=latest
|
||||
fi
|
||||
fi
|
||||
echo "npm-tag=$TAG_NPM" >> $GITHUB_OUTPUT
|
||||
echo "Computed tag: $TAG_NPM"
|
||||
if [[ ${{ inputs.branch_name }} =~ ^develop(-patch.*)?$ ]]; then
|
||||
TAG_NPM=alpha
|
||||
fi
|
||||
echo "TAG_NPM=${TAG_NPM}" >> $GITHUB_ENV
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
name: 'Install Google Chrome'
|
||||
description: 'Install Google Chrome'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install google chrome
|
||||
shell: bash
|
||||
run: |
|
||||
wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.133-1_amd64.deb
|
||||
sudo apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.133-1_amd64.deb
|
||||
sudo ln -s /usr/bin/google-chrome /usr/bin/chrome
|
||||
chrome --version
|
||||
@@ -1,12 +1,13 @@
|
||||
name: 'Setup'
|
||||
description: 'Initialize cache, env var load'
|
||||
inputs:
|
||||
cache-suffix:
|
||||
description: 'Suffix to make Nx cache key unique per job (e.g. matrix project name)'
|
||||
enable-cache:
|
||||
description: 'enable caching'
|
||||
required: false
|
||||
default: 'default'
|
||||
full-setup:
|
||||
description: 'Run git-latest-tag, npm-tag, and before-install (requires fetch-depth: 0). Set to false for matrix jobs that only need node/cache.'
|
||||
type: boolean
|
||||
default: 'true'
|
||||
enable-node-modules-cache:
|
||||
description: 'enable caching for node modules'
|
||||
required: false
|
||||
type: boolean
|
||||
default: 'true'
|
||||
@@ -15,50 +16,43 @@ inputs:
|
||||
required: false
|
||||
type: boolean
|
||||
default: 'false'
|
||||
outputs:
|
||||
npm-tag:
|
||||
description: 'NPM tag'
|
||||
value: ${{ steps.set-npm-tag.outputs.npm-tag }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set consistent machine ID for Nx cache
|
||||
shell: bash
|
||||
run: echo "nx-github-actions" | sudo tee /etc/machine-id > /dev/null
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
- name: install NPM
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: get latest tag sha
|
||||
if: ${{ inputs.full-setup == 'true' }}
|
||||
id: tag-sha
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@a297ff6c5bf20c667047db658dd23f60241b270a # v18.28.0
|
||||
- name: load "NPM TAG"
|
||||
if: ${{ inputs.full-setup == 'true' }}
|
||||
id: set-npm-tag
|
||||
uses: ./.github/actions/set-npm-tag
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Security audit
|
||||
shell: bash
|
||||
run: pnpm audit --audit-level=critical
|
||||
- name: Restore nx cache
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@v1.29.0
|
||||
# CACHE
|
||||
- name: Node Modules cache
|
||||
id: node-modules-cache
|
||||
if: ${{ inputs.enable-node-modules-cache == 'true' }}
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: node-modules-cache
|
||||
with:
|
||||
path: |
|
||||
nxcache
|
||||
.nx
|
||||
dist
|
||||
key: ${{ runner.os }}-nxcache-${{ inputs.cache-suffix }}-${{ hashFiles('nx.json') }}-${{ github.sha }}
|
||||
node_modules
|
||||
key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-nxcache-${{ inputs.cache-suffix }}-${{ hashFiles('nx.json') }}-
|
||||
${{ runner.os }}-nxcache-${{ inputs.cache-suffix }}-
|
||||
node_modules-${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
node_modules-${{ runner.os }}-build-
|
||||
node_modules-${{ runner.os }}-
|
||||
- name: pip cache
|
||||
uses: actions/cache@v3
|
||||
if: ${{ inputs.enable-cache == 'true' }}
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-
|
||||
restore-keys: |
|
||||
${{ runner.os }}
|
||||
- name: load "NPM TAG"
|
||||
uses: ./.github/actions/set-npm-tag
|
||||
- name: before install script
|
||||
if: ${{ inputs.full-setup == 'true' }}
|
||||
uses: ./.github/actions/before-install
|
||||
with:
|
||||
act: ${{ inputs.act }}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
name: Identify the slack group
|
||||
description: 'Identify the slack group area based on the affected'
|
||||
|
||||
inputs:
|
||||
affected:
|
||||
description: 'The name of the affected lib'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
groups:
|
||||
description: "the slack groups"
|
||||
value: ${{ steps.group.outputs.result }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: Append group
|
||||
id: group
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
affectedLib: ${{ inputs.affected }}
|
||||
with:
|
||||
script: |
|
||||
const affectedLib = process.env.affectedLib;
|
||||
core.info(`Input ${affectedLib}`);
|
||||
|
||||
const slackGroups = new Set();
|
||||
const AlfrescoQAGroup = '@alfresco-testing-qa';
|
||||
const HxpQAGroup = '@hxp-studio-qa-group';
|
||||
|
||||
const libs = affectedLib.split(' ')
|
||||
|
||||
if (libs.includes('content-services') || libs.includes('process-services')) {
|
||||
slackGroups.add(AlfrescoQAGroup);
|
||||
}
|
||||
if (libs.includes('process-services-cloud')) {
|
||||
slackGroups.add(HxpQAGroup);
|
||||
}
|
||||
if (libs.includes('core')) {
|
||||
slackGroups.add(AlfrescoQAGroup);
|
||||
slackGroups.add(HxpQAGroup);
|
||||
}
|
||||
|
||||
const result = Array.from(slackGroups.values()).join(' ');
|
||||
core.info(`Result ${result}`);
|
||||
return result;
|
||||
|
||||
@@ -4,22 +4,16 @@ description: "Upload build artifacts"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Save dist to cache
|
||||
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: dist
|
||||
key: dist-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
|
||||
- name: Save nxcache to cache
|
||||
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: nxcache
|
||||
key: nxcache-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
|
||||
- name: Save node_modules to cache
|
||||
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
- name: tar and upload artifacts
|
||||
shell: bash
|
||||
env:
|
||||
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
||||
run: |
|
||||
packages=( dist nxcache node_modules )
|
||||
for i in "${packages[@]}"; do
|
||||
time tar czf $i.tar.gz $i
|
||||
du -h $i.tar.gz
|
||||
time aws s3 cp --no-progress $i.tar.gz "s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz"
|
||||
done
|
||||
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
{
|
||||
"entries": {
|
||||
"github/gh-aw-actions/setup@v0.88.7": {
|
||||
"repo": "github/gh-aw-actions/setup",
|
||||
"version": "v0.88.7",
|
||||
"sha": "5e508589e03a7757a7e05b26e834292f5445bfb6"
|
||||
}
|
||||
},
|
||||
"containers": {
|
||||
"ghcr.io/github/gh-aw-firewall/agent:0.27.44": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/agent:0.27.44",
|
||||
"digest": "sha256:0d727725c737b58c7bdf51f640cffb928385ec46517e0917c7f1a02f1bada8b4",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/agent:0.27.44@sha256:0d727725c737b58c7bdf51f640cffb928385ec46517e0917c7f1a02f1bada8b4"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-firewall/agent:0.28.14": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/agent:0.28.14",
|
||||
"digest": "sha256:f7df036c86575527b61f3f7df91c4412349a12b2a74988d929eafa2999230c98",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/agent:0.28.14@sha256:f7df036c86575527b61f3f7df91c4412349a12b2a74988d929eafa2999230c98"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44",
|
||||
"digest": "sha256:b50fbadba138f6e9aba94aca09711335c489bb3b15861220cb66f6092e042dc7",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44@sha256:b50fbadba138f6e9aba94aca09711335c489bb3b15861220cb66f6092e042dc7"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-firewall/api-proxy:0.28.14": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/api-proxy:0.28.14",
|
||||
"digest": "sha256:6f95e2234dd9bd6333a8ff28ccea7ecf0204acd4a09108723844dbd2bf6268c5",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/api-proxy:0.28.14@sha256:6f95e2234dd9bd6333a8ff28ccea7ecf0204acd4a09108723844dbd2bf6268c5"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-firewall/squid:0.27.44": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/squid:0.27.44",
|
||||
"digest": "sha256:83e48bbe12c634be8c228a576832fe45f66c529ac3659db92bddbcf2eeb6d627",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/squid:0.27.44@sha256:83e48bbe12c634be8c228a576832fe45f66c529ac3659db92bddbcf2eeb6d627"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-firewall/squid:0.28.14": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/squid:0.28.14",
|
||||
"digest": "sha256:2ce8df3abf3e9b76e9c0cf5863da41f1ab3f89b20ad14b988806ab89e7bf2cd5",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/squid:0.28.14@sha256:2ce8df3abf3e9b76e9c0cf5863da41f1ab3f89b20ad14b988806ab89e7bf2cd5"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-mcpg:v0.4.18": {
|
||||
"image": "ghcr.io/github/gh-aw-mcpg:v0.4.18",
|
||||
"digest": "sha256:85b940556a8faa4e1fdbef124bfd75f2c4ebd855a10b88a1c3b6f3e97f6f1a53",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-mcpg:v0.4.18@sha256:85b940556a8faa4e1fdbef124bfd75f2c4ebd855a10b88a1c3b6f3e97f6f1a53"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-node": {
|
||||
"image": "ghcr.io/github/gh-aw-node",
|
||||
"digest": "sha256:87366cb93b06d7a4e3db08a705875efc027b6c394da336119e7a067abacbb39b",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-node@sha256:87366cb93b06d7a4e3db08a705875efc027b6c394da336119e7a067abacbb39b"
|
||||
},
|
||||
"ghcr.io/github/github-mcp-server:v1.11.0": {
|
||||
"image": "ghcr.io/github/github-mcp-server:v1.11.0",
|
||||
"digest": "sha256:fbec75de11c255213fa08d80fb166abe73d851fff631c51c0079872967720699",
|
||||
"pinned_image": "ghcr.io/github/github-mcp-server:v1.11.0@sha256:fbec75de11c255213fa08d80fb166abe73d851fff631c51c0079872967720699"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
name: "CodeQL config"
|
||||
|
||||
paths-ignore:
|
||||
- 'e2e/resources/**'
|
||||
- 'docs/**'
|
||||
- 'e2e/resources/**/*.*'
|
||||
- 'docs/**/*.*'
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
# General Code Review Instructions
|
||||
|
||||
## Review Priorities
|
||||
When performing a code review, prioritize issues in the following order:
|
||||
|
||||
🔴 CRITICAL (Block merge)
|
||||
* Security: Vulnerabilities, exposed secrets, authentication/authorization issues, injection, XSS
|
||||
* Memory/resource leaks
|
||||
* Crashes or undefined behavior
|
||||
* Correctness: Logic errors, data corruption risks, race conditions, missing error handling
|
||||
* Data Loss: Risk of data loss or corruption
|
||||
|
||||
🟡 IMPORTANT (Requires discussion)
|
||||
* Code Quality: Severe violations of SOLID principles, excessive duplication
|
||||
* Test Coverage: Missing tests for critical paths or new functionality
|
||||
* Performance: Obvious performance bottlenecks (N+1 queries, memory leaks)
|
||||
* Architecture: Significant deviations from established patterns
|
||||
|
||||
🟢 SUGGESTION (Non-blocking improvements)
|
||||
* Readability: Poor naming, complex logic that could be simplified
|
||||
* Optimization: Performance improvements without functional impact
|
||||
* Best Practices: Minor deviations from conventions
|
||||
* Documentation: Missing or incomplete comments/documentation
|
||||
|
||||
## General Review Principles
|
||||
When performing a code review, follow these principles:
|
||||
|
||||
* Be specific: Reference exact lines, files, and provide concrete examples
|
||||
* Be pragmatic: Not every suggestion needs immediate implementation
|
||||
* Provide context: Explain WHY something is an issue and the potential impact
|
||||
* Suggest solutions: Show corrected code when applicable, not just what's wrong
|
||||
* Be constructive: Focus on improving the code, not criticizing the author
|
||||
* Recognize good practices: Acknowledge well-written code and smart solutions
|
||||
* Group related comments: Avoid multiple comments about the same topic
|
||||
* Ask clarifying questions when code intent is unclear
|
||||
|
||||
## Code Quality Standards
|
||||
When performing a code review, check for:
|
||||
|
||||
### Clean Code
|
||||
* Descriptive and meaningful names for variables, functions, and classes
|
||||
* Single Responsibility Principle: each function/class does one thing well
|
||||
* DRY (Don't Repeat Yourself): no code duplication
|
||||
* Functions should be small and focused (ideally < 20-30 lines)
|
||||
* Avoid deeply nested code (max 3-4 levels), unit tests should be an exception from this rule
|
||||
* Avoid magic numbers and strings (use constants)
|
||||
* Code should be self-documenting; comments only when necessary
|
||||
* Code follows consistent style and conventions
|
||||
* No commented-out code or TODO without tickets
|
||||
|
||||
## Error Handling
|
||||
* Proper error handling at appropriate levels
|
||||
* Meaningful error messages
|
||||
* No silent failures or ignored exceptions
|
||||
* Fail fast: validate inputs early
|
||||
* Use appropriate error types/exceptions
|
||||
|
||||
## Testing Standards
|
||||
When performing a code review, verify test quality:
|
||||
|
||||
* Coverage: Critical paths and new functionality must have tests
|
||||
* Test Names: Descriptive names that explain what is being tested
|
||||
* Independence: Tests should not depend on each other or external state
|
||||
* Assertions: Use specific assertions, avoid generics
|
||||
* Edge Cases: Test boundary conditions, null values, empty inputs
|
||||
* Mock Appropriately: Mock external dependencies, not domain logic
|
||||
* New code has appropriate test coverage
|
||||
* No tests that always pass or are commented out
|
||||
|
||||
## Architecture and Design
|
||||
When performing a code review, verify architectural principles:
|
||||
|
||||
* Separation of Concerns: Clear boundaries between layers/modules
|
||||
* Dependency Direction: High-level modules don't depend on low-level details
|
||||
* Interface Segregation: Prefer small, focused interfaces
|
||||
* Loose Coupling: Components should be independently testable
|
||||
* High Cohesion: Related functionality grouped together
|
||||
* Consistent Patterns: Follow established patterns in the codebase
|
||||
+25
-54
@@ -1,60 +1,31 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "sunday"
|
||||
time: "07:00"
|
||||
cooldown:
|
||||
default-days: 3
|
||||
open-pull-requests-limit: 5
|
||||
target-branch: develop
|
||||
groups:
|
||||
angular:
|
||||
patterns:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "sunday"
|
||||
time: "07:00"
|
||||
open-pull-requests-limit: 5
|
||||
target-branch: develop
|
||||
groups:
|
||||
- label: "Angular Updates"
|
||||
packages:
|
||||
- "@angular/*"
|
||||
angular-devkit:
|
||||
patterns:
|
||||
version: "widen"
|
||||
- label: "Angular-devkit Updates"
|
||||
packages:
|
||||
- "@angular-devkit/*"
|
||||
ngrx:
|
||||
patterns:
|
||||
version: "widen"
|
||||
- label: "ngrx Updates"
|
||||
packages:
|
||||
- "@ngrx/*"
|
||||
nrwl:
|
||||
patterns:
|
||||
version: "widen"
|
||||
- label: "nrwl Updates"
|
||||
packages:
|
||||
- "@nrwl/*"
|
||||
typescript-eslint:
|
||||
patterns:
|
||||
- "@typescript-eslint/*"
|
||||
ignore:
|
||||
- dependency-name: "pdfjs-dist"
|
||||
- dependency-name: "@types/*"
|
||||
- dependency-name: "typescript"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directories:
|
||||
- "/"
|
||||
- "/.github/actions/before-install"
|
||||
- "/.github/actions/create-git-tag"
|
||||
- "/.github/actions/download-node-modules-and-artifacts"
|
||||
- "/.github/actions/enable-dryrun"
|
||||
- "/.github/actions/get-latest-tag-sha"
|
||||
- "/.github/actions/npm-check-bundle"
|
||||
- "/.github/actions/save-nx-cache"
|
||||
- "/.github/actions/set-npm-tag"
|
||||
- "/.github/actions/setup"
|
||||
- "/.github/actions/upload-node-modules-and-artifacts"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
cooldown:
|
||||
default-days: 3
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
ignore:
|
||||
# Managed by gh aw add. Version-locked to the gh-aw compiler; do not bump.
|
||||
- dependency-name: "github/gh-aw-actions"
|
||||
version: "widen"
|
||||
ignore:
|
||||
- dependency-name: "pdfjs-dist"
|
||||
- dependency-name: "@types/*"
|
||||
- dependency-name: "typescript"
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
applyTo: "**/*.html"
|
||||
---
|
||||
|
||||
# HTML Development Standards
|
||||
|
||||
* Simple Templates: Keep templates as simple as possible, avoiding complex logic directly in the template. Delegate complex logic to the component's TypeScript code.
|
||||
* Native Control Flow: Use the new built-in control flow syntax (`@if`, `@for`, `@switch`) instead of the older structural directives (`*ngIf`, `*ngFor`, `*ngSwitch`).
|
||||
* NgOptimizedImage: Use `NgOptimizedImage` for all static images to automatically optimize image loading and performance.
|
||||
* Async Pipe: Use the `async` pipe to handle observables in templates. This automatically subscribes and unsubscribes, preventing memory leaks.
|
||||
* Prefer pipes over functions in templates for performance reasons, as pipes are only re-evaluated when their inputs change.
|
||||
|
||||
## Accessibility Standards
|
||||
|
||||
* Add `alt` text to all images
|
||||
* Label form inputs with `<mat-label>` or `aria-label`
|
||||
* Ensure interactive elements have accessible names
|
||||
* Add `role`, `aria-labelledby`, and `aria-describedby` when semantic HTML isn't sufficient
|
||||
* All interactive elements must be keyboard accessible
|
||||
* Ensure 4.5:1 contrast ratio for normal text, 3:1 for large text
|
||||
* Use `aria-live="polite"` for status updates
|
||||
* Watch out for misused/non-semantic elements (e.g., <div> instead of <section>)
|
||||
* Avoid broken heading hierarchy (e.g., h1 → h3 without h2)
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
applyTo: "**/*.scss"
|
||||
---
|
||||
|
||||
# SCSS Development Standards
|
||||
|
||||
* Avoid using `!important` to override styles unless absolutely necessary; instead, increase specificity or refactor the code structure.
|
||||
* Avoid using Angular Material internal class; prefer using Angular Material Design 3 theming and tokens.
|
||||
* Use variables for colors, fonts, and other design tokens to maintain consistency across the project.
|
||||
* Use mixins for reusable styles and to avoid code duplication.
|
||||
* Ensure that styles are responsive and work well across different screen sizes and devices.
|
||||
* Use CSS Grid and Flexbox for layout to create flexible and responsive designs.
|
||||
* Avoid using overly specific selectors (e.g., #header .nav ul li a)
|
||||
* Be DRY (avoid repeated styles for similar elements)
|
||||
* Check for inconsistent naming (e.g., mixing BEM and arbitrary classes)
|
||||
* Make sure selected colors have right contrast (satisfy WCAG AA)
|
||||
* All interactive elements should have focus state
|
||||
* Avoid disabled outline without alternative focus indicators
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
---
|
||||
applyTo: "**/*.ts"
|
||||
---
|
||||
|
||||
# TypeScript Development Standards
|
||||
|
||||
## Type Safety
|
||||
|
||||
* Strict Type Checking: Always enable and adhere to strict type checking. This helps catch errors early and improves code quality.
|
||||
* Prefer Type Inference: Allow TypeScript to infer types when they are obvious from the context. This reduces verbosity while maintaining type safety.
|
||||
* Avoid `any`: Do not use the `any` type unless absolutely necessary as it bypasses type checking. Prefer `unknown` when a type is uncertain and you need to handle it safely.
|
||||
* Use strict null checks (no `null` or `undefined` without explicit handling)
|
||||
* Use type guards and union types for robust type checking
|
||||
* Check for missing return types in function signatures
|
||||
* Avoid implicit `any` (untyped function parameters)
|
||||
|
||||
## Naming Conventions
|
||||
|
||||
* Use PascalCase for types, interfaces, and classes
|
||||
* Use camelCase for variables, functions, and methods
|
||||
* Use UPPER_CASE for constants
|
||||
|
||||
## Modern TypeScript Patterns
|
||||
|
||||
* Use optional chaining (`?.`) and nullish coalescing (`??`)
|
||||
* Prefer `const` over `let`; never use `var`
|
||||
* Use arrow functions for callbacks and short functions
|
||||
* Avoid enums - they generate additional code at compile time, which increases the size of the final file. This can have a negative impact on the loading speed and performance of the app. Prefer union types or literal types instead.
|
||||
* Avoid unhandled promise rejections (missing .catch() or try/catch)
|
||||
* Use proper async/await pattern
|
||||
* Avoid inefficient array operations (e.g., nested .map())
|
||||
* Use destructuring for object/array access
|
||||
* Prefer arrow functions
|
||||
|
||||
## Angular Best Practices
|
||||
|
||||
* Standalone Components: Always use standalone components, directives, and pipes. Avoid using `NgModules` for new features or refactoring existing ones.
|
||||
* Implicit Standalone: When creating standalone components, you do not need to explicitly set `standalone: true` inside the `@Component`, `@Directive` and `@Pipe` decorators, as it is implied by default.
|
||||
* Lazy Loading: Implement lazy loading for feature routes to improve initial load times of your application.
|
||||
* Use Angular Material or other modern UI libraries for consistent styling and UI components.
|
||||
* Implement proper error handling with RxJS operators (e.g., catchError)
|
||||
* Verify if newly added functionalities can utilize Angular Signals for fine-grained reactivity, reducing change detection overhead.
|
||||
* Utilize AOT (Ahead-of-Time) compilation and tree-shaking for efficient, smaller bundle sizes.
|
||||
* Prefer class binding over `ngClass` and `ngStyle` for better performance.
|
||||
* Use protected on class members that are only used by a component's template, as it allows for better encapsulation while still being accessible to the template.
|
||||
* Use readonly for properties that shouldn't change.
|
||||
* Use `takeUntilDestroyed` & `destroyRef`: The `takeUntilDestroyed` and `destroyRef` have been introduced with Angular 16 and help to reduce boilerplate code related to unsubscribing on the `OnDestroy` hook.
|
||||
* Organize the order of properties and methods in Angular components for readability and maintainability. Recommended order is:
|
||||
1. **Injected services** Whether they are public or private, it's clear they are dependencies of the class.
|
||||
2. **Inputs**: Properties that receive data from outside.
|
||||
3. **Outputs**: Events that the component can trigger.
|
||||
4. **ViewChild/ContentChild**: References to HTML elements.
|
||||
5. **Public static properties**: Constants and static members that are accessible to everyone.
|
||||
6. **Readonly properties**: Immutable public properties.
|
||||
7. **Public properties**: Data and functions available to everyone.
|
||||
8. **Private static properties**: Constants and static members that are only accessible within the class.
|
||||
9. **Private readonly properties**: Immutable private properties.
|
||||
10. **Private properties**: Data and functions used only inside the component.
|
||||
11. **Setters and Getters**: Methods for accessing and modifying properties.
|
||||
12. **Constructor**: Used to initialize the component.
|
||||
13. **Lifecycle Hooks**: Methods that run at specific times in the component’s lifecycle.
|
||||
14. **Public methods**: Functions available to everyone.
|
||||
15. **Private methods**: Functions used only inside the component.
|
||||
|
||||
## Components
|
||||
|
||||
* Single Responsibility: Keep components small, focused, and responsible for a single piece of functionality.
|
||||
* Reactive Forms: Prefer Reactive forms over Template-driven forms for complex forms, validation, and dynamic controls due to their explicit, immutable, and synchronous nature.
|
||||
* Use Typed Forms: Typed Forms in Angular are a new feature introduced in Angular 14 that provide stronger type checking for reactive forms. They allow developers to define the structure and types of form controls, making it easier to catch errors at compile-time rather than runtime.
|
||||
|
||||
## Services
|
||||
|
||||
* Single Responsibility: Design services around a single, well-defined responsibility.
|
||||
* `providedIn: 'root'`: Use the `providedIn: 'root'` option when declaring injectable services to ensure they are singletons and tree-shakable.
|
||||
* `inject()` Function: Prefer the `inject()` function over constructor injection when injecting dependencies, especially within `provide` functions, `computed` properties, or outside of constructor context.
|
||||
|
||||
## Unit testing
|
||||
|
||||
* Write unit tests for components, services, and pipes using Jasmine and Karma.
|
||||
* Test cases should be reasonably groupped based on tested functionality/behaviour using describe blocks.
|
||||
* Use plain English test names based on the should <expectedBehavior> when <stateUnderTest> pattern as a guideline.
|
||||
* Use Angular's TestBed for component testing with mocked dependencies
|
||||
* Avoid Direct Calls to Component Lifecycle Hooks: Instead of directly invoking lifecycle hooks like `ngOnInit()`, use Angular's testing utilities to trigger them naturally. For example, use `fixture.detectChanges()` to trigger change detection, which will automatically call `ngOnInit()` and other lifecycle hooks in the correct order.
|
||||
* Use fixture.componentRef.setInput() Instead of Direct Input Assignment: When testing components with inputs, use `fixture.componentRef.setInput()` to set input values. This method ensures that Angular's change detection is properly triggered, allowing the component to react to input changes as it would in a real application.
|
||||
* Use the Provide Mock Store for testing components that rely on NgRx state management. This allows you to mock the store and control the state during tests without needing to set up a full NgRx environment.
|
||||
* Mock HTTP requests using provideHttpClientTesting
|
||||
* Import only the minimal required modules
|
||||
* Avoid NO_ERRORS_SCHEMA and CUSTOM_ELEMENTS_SCHEMA in tests to ensure proper error detection
|
||||
* Do not verify mocked methods
|
||||
* Avoid mocking component methods unless necessary; prefer testing actual behavior
|
||||
* Avoid testing private methods directly; test them through public methods instead
|
||||
* Avoid testing methods or behaviours of children components; use shallow testing or mock child components instead
|
||||
* Use the overrideProviders API to replace components, directives, pipes, or services declared deep within the module hierarchy
|
||||
* Avoid async/await in synchronous unit tests
|
||||
* Prefer data-automation-id over CSS class when possible
|
||||
* Do not use toBeDefined() to check if an element is visible.
|
||||
@@ -1,39 +0,0 @@
|
||||
name: "Build Lib Workflow"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
base_ref:
|
||||
description: 'Base branch for affected calculation'
|
||||
required: false
|
||||
type: string
|
||||
default: 'develop'
|
||||
|
||||
env:
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Build affected libs"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
id: setup-env
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
cache-suffix: build
|
||||
full-setup: 'false'
|
||||
- name: Build affected libs
|
||||
env:
|
||||
BASE_REF: ${{ inputs.base_ref }}
|
||||
run: pnpm nx affected --target=build --base=origin/$BASE_REF --head=HEAD --configuration=production --exclude=stories
|
||||
- name: Save nx cache
|
||||
if: ${{ success() }}
|
||||
uses: ./.github/actions/save-nx-cache
|
||||
with:
|
||||
cache-suffix: build
|
||||
@@ -4,14 +4,14 @@ on:
|
||||
push:
|
||||
branches: [develop, master]
|
||||
paths-ignore:
|
||||
- 'e2e/resources/**'
|
||||
- 'docs/**'
|
||||
- 'e2e/resources/**/*.*'
|
||||
- 'docs/**/*.*'
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [develop]
|
||||
paths-ignore:
|
||||
- 'e2e/resources/**'
|
||||
- 'docs/**'
|
||||
- 'e2e/resources/**/*.*'
|
||||
- 'docs/**/*.*'
|
||||
schedule:
|
||||
- cron: '0 5 * * 0'
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v3.29.5
|
||||
uses: github/codeql-action/init@v2
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: javascript
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v3.29.5
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -53,4 +53,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v3.29.5
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
name: "cron e2e daily"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 12 * * 1-5' #At 12:00 on every day-of-week from Monday through Friday.
|
||||
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
GITHUB_BRANCH: ${{ github.ref_name }}
|
||||
GH_BUILD_DIR: ${{ github.workspace }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
BUILD_ID: ${{ github.run_id }}
|
||||
GH_RUN_NUMBER: ${{ github.run_attempt }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
JOB_ID: ${{ github.run_id }}
|
||||
PROXY_HOST_BPM: ${{ secrets.E2E_HOST }}
|
||||
E2E_HOST_APA: ${{ secrets.E2E_HOST_APA }}
|
||||
E2E_IDENTITY_HOST_APA: ${{ secrets.E2E_IDENTITY_HOST_APA }}
|
||||
E2E_HOST: ${{ secrets.E2E_HOST }}
|
||||
E2E_USERNAME: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
|
||||
E2E_ADMIN_EMAIL_IDENTITY: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_ADMIN_PASSWORD_IDENTITY: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
USERNAME_ADF: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
PASSWORD_ADF: ${{ secrets.E2E_PASSWORD }}
|
||||
URL_HOST_ADF: "http://localhost:4200"
|
||||
IDENTITY_ADMIN_EMAIL: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
IDENTITY_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
AWS_S3_BUCKET_ACTIVITI_LICENSE: ${{ secrets.AWS_S3_BUCKET_ACTIVITI_LICENSE }}
|
||||
HOST_SSO: ${{ secrets.HOST_SSO }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
E2E_LOG_LEVEL: "ERROR"
|
||||
E2E_MODELER_USERNAME: ${{ secrets.E2E_MODELER_USERNAME }}
|
||||
E2E_MODELER_PASSWORD: ${{ secrets.E2E_MODELER_PASSWORD }}
|
||||
EXTERNAL_ACS_HOST: ${{ secrets.EXTERNAL_ACS_HOST }}
|
||||
E2E_DEVOPS_USERNAME: ${{ secrets.E2E_DEVOPS_USERNAME }}
|
||||
E2E_DEVOPS_PASSWORD: ${{ secrets.E2E_DEVOPS_PASSWORD }}
|
||||
USERNAME_SUPER_ADMIN_ADF: ${{ secrets.USERNAME_SUPER_ADMIN_ADF }}
|
||||
PASSWORD_SUPER_ADMIN_ADF: ${{ secrets.PASSWORD_SUPER_ADMIN_ADF }}
|
||||
HR_USER: ${{ secrets.HR_USER }}
|
||||
HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }}
|
||||
SMART_RUNNER_PATH: ".protractor-smartrunner"
|
||||
S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }}
|
||||
S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }}
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }}
|
||||
DOCKER_REPOSITORY_USER: ${{ secrets.DOCKER_REPOSITORY_USER }}
|
||||
DOCKER_REPOSITORY_PASSWORD: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}
|
||||
DOCKER_REPOSITORY_STORYBOOK: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/storybook"
|
||||
DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell"
|
||||
REPO_OWNER: "Alfresco"
|
||||
REPO_NAME: "alfresco-ng2-components"
|
||||
DEMO_SHELL_DIR: "./dist/demo-shell"
|
||||
STORYBOOK_DIR: "./dist/storybook/stories"
|
||||
BUILT_LIBS_DIR: "./dist/libs"
|
||||
NODE_MODULES_DIR: "./node_modules"
|
||||
SMART_RUNNER_DIRECTORY: ".protractor-smartrunner"
|
||||
SAVE_SCREENSHOT: true
|
||||
REDIRECT_URI: /
|
||||
BROWSER_RUN: false
|
||||
MAXINSTANCES: 2
|
||||
PLAYWRIGHT_WORKERS: 2
|
||||
PLAYWRIGHT_STORYBOOK_E2E_HOST: http://localhost
|
||||
PLAYWRIGHT_STORYBOOK_E2E_PORT: 4400
|
||||
PROXY_HOST_ECM: ${{ secrets.E2E_HOST }}
|
||||
|
||||
jobs:
|
||||
init-artifact:
|
||||
runs-on: ubuntu-latest
|
||||
name: Initialize artifacts
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/artifact-initialize
|
||||
with:
|
||||
artifact-name: global-e2e-result
|
||||
file-name: e2e-failures.txt
|
||||
|
||||
run-e2e:
|
||||
name: run e2e
|
||||
uses: ./.github/workflows/pull-request.yml
|
||||
with:
|
||||
cron-run: true
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,112 @@
|
||||
name: "git-tag"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dry-run on artifact push'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- master-patch-*
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
GITHUB_BRANCH: ${{ github.ref_name }}
|
||||
GH_BUILD_DIR: ${{ github.workspace }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
BUILD_ID: ${{ github.run_id }}
|
||||
GH_RUN_NUMBER: ${{ github.run_attempt }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
JOB_ID: ${{ github.run_id }}
|
||||
PROXY_HOST_BPM: ${{ secrets.E2E_HOST }}
|
||||
E2E_IDENTITY_HOST_APA: ${{ secrets.E2E_IDENTITY_HOST_APA }}
|
||||
E2E_HOST_APA: ${{ secrets.E2E_HOST_APA }}
|
||||
E2E_HOST: ${{ secrets.E2E_HOST }}
|
||||
E2E_USERNAME: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
|
||||
E2E_ADMIN_EMAIL_IDENTITY: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_ADMIN_PASSWORD_IDENTITY: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
USERNAME_ADF: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
PASSWORD_ADF: ${{ secrets.E2E_PASSWORD }}
|
||||
URL_HOST_ADF: "http://localhost:4200"
|
||||
IDENTITY_ADMIN_EMAIL: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
IDENTITY_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
AWS_S3_BUCKET_ACTIVITI_LICENSE: ${{ secrets.AWS_S3_BUCKET_ACTIVITI_LICENSE }}
|
||||
HOST_SSO: ${{ secrets.HOST_SSO }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
E2E_LOG_LEVEL: "ERROR"
|
||||
E2E_MODELER_USERNAME: ${{ secrets.E2E_MODELER_USERNAME }}
|
||||
E2E_MODELER_PASSWORD: ${{ secrets.E2E_MODELER_PASSWORD }}
|
||||
EXTERNAL_ACS_HOST: ${{ secrets.EXTERNAL_ACS_HOST }}
|
||||
E2E_DEVOPS_USERNAME: ${{ secrets.E2E_DEVOPS_USERNAME }}
|
||||
E2E_DEVOPS_PASSWORD: ${{ secrets.E2E_DEVOPS_PASSWORD }}
|
||||
USERNAME_SUPER_ADMIN_ADF: ${{ secrets.USERNAME_SUPER_ADMIN_ADF }}
|
||||
PASSWORD_SUPER_ADMIN_ADF: ${{ secrets.PASSWORD_SUPER_ADMIN_ADF }}
|
||||
HR_USER: ${{ secrets.HR_USER }}
|
||||
HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }}
|
||||
SMART_RUNNER_PATH: ".protractor-smartrunner"
|
||||
S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }}
|
||||
S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }}
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }}
|
||||
DOCKER_REPOSITORY_USER: ${{ secrets.DOCKER_REPOSITORY_USER }}
|
||||
DOCKER_REPOSITORY_PASSWORD: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}
|
||||
DOCKER_REPOSITORY_STORYBOOK: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/storybook"
|
||||
DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell"
|
||||
NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }}
|
||||
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
||||
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
REPO_OWNER: "Alfresco"
|
||||
REPO_NAME: "alfresco-ng2-components"
|
||||
DEMO_SHELL_DIR: "./dist/demo-shell"
|
||||
STORYBOOK_DIR: "./dist/storybook/stories"
|
||||
BUILT_LIBS_DIR: "./dist/libs"
|
||||
NODE_MODULES_DIR: "./node_modules"
|
||||
SMART_RUNNER_DIRECTORY: ".protractor-smartrunner"
|
||||
SAVE_SCREENSHOT: true
|
||||
REDIRECT_URI: /
|
||||
BROWSER_RUN: false
|
||||
MAXINSTANCES: 2
|
||||
PLAYWRIGHT_WORKERS: 2
|
||||
PLAYWRIGHT_STORYBOOK_E2E_HOST: http://localhost
|
||||
PLAYWRIGHT_STORYBOOK_E2E_PORT: 4400
|
||||
PROXY_HOST_ECM: ${{ secrets.E2E_HOST }}
|
||||
|
||||
jobs:
|
||||
|
||||
release:
|
||||
uses: ./.github/workflows/release.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
dry-run-flag: false
|
||||
|
||||
setup:
|
||||
needs: release
|
||||
timeout-minutes: 20
|
||||
name: "Release tag"
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
GITHUB_TOKEN: $BOT_GITHUB_TOKEN
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- id: set-dryrun
|
||||
uses: ./.github/actions/enable-dryrun
|
||||
with:
|
||||
dry-run-flag: ${{ inputs.dry-run-flag }}
|
||||
- name: install NPM
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- name: "Release tag"
|
||||
run: |
|
||||
git fetch --all --quiet
|
||||
BRANCH=${GITHUB_REF##*/} ./scripts/github/release/git-tag.sh ${{ steps.set-dryrun.outputs.dryrun }}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
name: "Sends notification when A/N BDU label is attached to PR"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
branches: [develop]
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
issues: read
|
||||
|
||||
jobs:
|
||||
notify-bdu:
|
||||
name: Notify Teams when A/N BDU label is added
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
if: >-
|
||||
github.event.action == 'labeled' &&
|
||||
github.event.label.name == 'A/N BDU' &&
|
||||
github.event.pull_request.state == 'open'
|
||||
steps:
|
||||
- name: Check if label was added after PR creation (with time threshold)
|
||||
id: check_label_timing
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
const prCreatedAt = new Date('${{ github.event.pull_request.created_at }}');
|
||||
|
||||
const timeline = await github.rest.issues.listEvents({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
});
|
||||
|
||||
const labelEvent = timeline.data.reverse().find(event =>
|
||||
event.event === 'labeled' &&
|
||||
event.label.name === 'A/N BDU'
|
||||
);
|
||||
|
||||
if (!labelEvent) {
|
||||
core.setOutput('should_notify', 'false');
|
||||
return;
|
||||
}
|
||||
|
||||
const labelAddedAt = new Date(labelEvent.created_at);
|
||||
const timeDiffSeconds = (labelAddedAt - prCreatedAt) / 1000;
|
||||
|
||||
if (timeDiffSeconds > 15) {
|
||||
core.setOutput('should_notify', 'true');
|
||||
} else {
|
||||
core.setOutput('should_notify', 'false');
|
||||
}
|
||||
|
||||
- name: Send Teams notification
|
||||
if: steps.check_label_timing.outputs.should_notify == 'true'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/send-teams-notification@a297ff6c5bf20c667047db658dd23f60241b270a # v18.28.0
|
||||
with:
|
||||
webhook-url: ${{ secrets.TEAMS_NOTIFICATION_ADF_BDU_WEBHOOK }}
|
||||
skip_checkout: true
|
||||
status: success
|
||||
title: "A/N BDU PR: ${{ github.event.pull_request.title }}"
|
||||
message: |
|
||||
A pull request has been marked with the **A/N BDU** label.
|
||||
|
||||
- **Repository:** ${{ github.repository }}
|
||||
- **PR:** [#${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})
|
||||
- **Author:** ${{ github.event.pull_request.user.login }}
|
||||
@@ -8,27 +8,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.registry_package.package_type == 'npm' && github.event.registry_package.name == 'adf-core'
|
||||
steps:
|
||||
- name: Generate app token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
with:
|
||||
client-id: ${{ vars.GH_APP_ENGINEERING_CONTRIB_CLIENT_ID }}
|
||||
private-key: ${{ secrets.GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repositories: alfresco-apps
|
||||
permission-contents: write
|
||||
- name: Dispatch event to monorepo
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
env:
|
||||
PACKAGE_NAME: ${{ github.event.registry_package.name }}
|
||||
PACKAGE_VERSION: ${{ github.event.registry_package.package_version.name }}
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
github-token: ${{ secrets.PAT_WRITE_PKG }}
|
||||
retries: 3
|
||||
script: |
|
||||
const payload = {
|
||||
package_name: process.env.PACKAGE_NAME,
|
||||
package_version: process.env.PACKAGE_VERSION
|
||||
package_name: "${{ github.event.registry_package.name }}",
|
||||
package_version: "${{ github.event.registry_package.package_version.name }}"
|
||||
};
|
||||
|
||||
await github.rest.repos.createDispatchEvent({
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
name: Pull Translations from Crowdin
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 7-17 * * 1-5"
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
secrets:
|
||||
GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY:
|
||||
required: true
|
||||
CROWDIN_TRANSLATIONS_TOKEN:
|
||||
required: true
|
||||
HXPS_GIT_COMMIT_SIGNING_PRIVATE_KEY:
|
||||
required: true
|
||||
jobs:
|
||||
pull-from-crowdin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate app token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
with:
|
||||
client-id: ${{ vars.GH_APP_ENGINEERING_CONTRIB_CLIENT_ID }}
|
||||
private-key: ${{ secrets.GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY }}
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: develop
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Pull translations from Crowdin
|
||||
uses: crowdin/github-action@0d5670f539973aea2f01abce61a8989934df0025 # v3.0.2
|
||||
with:
|
||||
skip_ref_checkout: true
|
||||
upload_sources: false
|
||||
download_translations: true
|
||||
create_pull_request: true
|
||||
localization_branch_name: automated-translations-update
|
||||
pull_request_title: "GH auto: Automated Update of Translations from Crowdin"
|
||||
pull_request_base_branch_name: develop
|
||||
github_user_name: ${{ vars.HXPS_GIT_USERNAME }}
|
||||
github_user_email: ${{ vars.HXPS_GIT_EMAIL }}
|
||||
gpg_private_key: ${{ secrets.HXPS_GIT_COMMIT_SIGNING_PRIVATE_KEY }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
+424
-246
@@ -4,17 +4,17 @@ on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: "enable dry-run on artifact push"
|
||||
description: 'enable dry-run on artifact push'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
devel:
|
||||
description: "devel"
|
||||
description: 'devel'
|
||||
required: false
|
||||
type: boolean
|
||||
type: string
|
||||
default: false
|
||||
cron-run:
|
||||
description: "disables jobs which should not run when cron runs e2es"
|
||||
description: 'disables jobs which should not run when cron runs e2es'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -31,314 +31,492 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
GITHUB_BRANCH: ${{ github.ref_name }}
|
||||
GH_BUILD_DIR: ${{ github.workspace }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
BUILD_ID: ${{ github.run_id }}
|
||||
GH_RUN_NUMBER: ${{ github.run_attempt }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
JOB_ID: ${{ github.run_id }}
|
||||
PROXY_HOST_BPM: ${{ secrets.E2E_HOST }}
|
||||
E2E_IDENTITY_HOST_APA: ${{ secrets.E2E_IDENTITY_HOST_APA }}
|
||||
E2E_HOST_APA: ${{ secrets.E2E_HOST_APA }}
|
||||
E2E_HOST: ${{ secrets.E2E_HOST }}
|
||||
E2E_USERNAME: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
|
||||
E2E_ADMIN_EMAIL_IDENTITY: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_ADMIN_PASSWORD_IDENTITY: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
USERNAME_ADF: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
PASSWORD_ADF: ${{ secrets.E2E_PASSWORD }}
|
||||
URL_HOST_ADF: "http://localhost:4200"
|
||||
IDENTITY_ADMIN_EMAIL: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
IDENTITY_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
AWS_S3_BUCKET_ACTIVITI_LICENSE: ${{ secrets.AWS_S3_BUCKET_ACTIVITI_LICENSE }}
|
||||
HOST_SSO: ${{ secrets.HOST_SSO }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
E2E_LOG_LEVEL: "ERROR"
|
||||
E2E_MODELER_USERNAME: ${{ secrets.E2E_MODELER_USERNAME }}
|
||||
E2E_MODELER_PASSWORD: ${{ secrets.E2E_MODELER_PASSWORD }}
|
||||
EXTERNAL_ACS_HOST: ${{ secrets.EXTERNAL_ACS_HOST }}
|
||||
E2E_DEVOPS_USERNAME: ${{ secrets.E2E_DEVOPS_USERNAME }}
|
||||
E2E_DEVOPS_PASSWORD: ${{ secrets.E2E_DEVOPS_PASSWORD }}
|
||||
USERNAME_SUPER_ADMIN_ADF: ${{ secrets.USERNAME_SUPER_ADMIN_ADF }}
|
||||
PASSWORD_SUPER_ADMIN_ADF: ${{ secrets.PASSWORD_SUPER_ADMIN_ADF }}
|
||||
HR_USER: ${{ secrets.HR_USER }}
|
||||
HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }}
|
||||
SMART_RUNNER_PATH: ".protractor-smartrunner"
|
||||
S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }}
|
||||
S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }}
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }}
|
||||
DOCKER_REPOSITORY_USER: ${{ secrets.DOCKER_REPOSITORY_USER }}
|
||||
DOCKER_REPOSITORY_PASSWORD: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}
|
||||
DOCKER_REPOSITORY_STORYBOOK: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/storybook"
|
||||
DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell"
|
||||
REPO_OWNER: "Alfresco"
|
||||
REPO_NAME: "alfresco-ng2-components"
|
||||
DEMO_SHELL_DIR: "./dist/demo-shell"
|
||||
STORYBOOK_DIR: "./dist/storybook/stories"
|
||||
BUILT_LIBS_DIR: "./dist/libs"
|
||||
NODE_MODULES_DIR: "./node_modules"
|
||||
SMART_RUNNER_DIRECTORY: ".protractor-smartrunner"
|
||||
SAVE_SCREENSHOT: true
|
||||
REDIRECT_URI: /
|
||||
BROWSER_RUN: false
|
||||
MAXINSTANCES: 2
|
||||
PLAYWRIGHT_WORKERS: 2
|
||||
PLAYWRIGHT_STORYBOOK_E2E_HOST: http://localhost
|
||||
PLAYWRIGHT_STORYBOOK_E2E_PORT: 4400
|
||||
PROXY_HOST_ECM: ${{ secrets.E2E_HOST }}
|
||||
|
||||
jobs:
|
||||
pre-checks:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
code-changed: ${{ steps.path-filter.outputs.code-changed }}
|
||||
check-package-lock:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Ensure SHA pinned actions
|
||||
uses: hyland/github-actions-ensure-sha-pinned-actions@7957efb76aba0eec7580a9c0392d3e5bec381359 # v2.0.1
|
||||
|
||||
- name: Check pnpm-lock.yaml version
|
||||
- name: Check package-lock.json version
|
||||
run: |
|
||||
if [[ -f "pnpm-lock.yaml" ]]; then
|
||||
LOCKFILE_VERSION=$(grep "^lockfileVersion:" pnpm-lock.yaml | cut -d"'" -f2)
|
||||
if [[ "$LOCKFILE_VERSION" == "9.0" ]]; then
|
||||
echo "pnpm-lock.yaml has correct version: $LOCKFILE_VERSION"
|
||||
else
|
||||
echo "pnpm-lock.yaml must be version 9.0, found: $LOCKFILE_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $(jq '.lockfileVersion == 3' package-lock.json) == "true" ]] ; then
|
||||
echo "package-lock.json has a correct version"
|
||||
else
|
||||
echo "pnpm-lock.yaml is missing"
|
||||
echo "package-lock must be version 3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Detect code changes
|
||||
id: path-filter
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" != "pull_request" ]; then
|
||||
echo "Not a PR event — assuming code changed"
|
||||
echo "code-changed=true" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
FILES=$(gh api /repos/$GITHUB_REPOSITORY/pulls/${{ github.event.pull_request.number }}/files --paginate --jq '.[].filename')
|
||||
|
||||
CODE_CHANGED="false"
|
||||
while IFS= read -r file; do
|
||||
case "$file" in
|
||||
*.md|docs/*|.github/*.md|.github/CODEOWNERS|.github/dependabot.yml|LICENSE*|NOTICE*|.editorconfig|.gitattributes)
|
||||
;;
|
||||
*)
|
||||
CODE_CHANGED="true"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done <<< "$FILES"
|
||||
|
||||
echo "code-changed=$CODE_CHANGED" >> $GITHUB_OUTPUT
|
||||
echo "Code changed: $CODE_CHANGED"
|
||||
|
||||
check-if-pr-is-approved:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 1
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check if PR approval can be skipped
|
||||
id: skip-check
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
ACTOR: ${{ github.actor }}
|
||||
DEVEL_FLAG: ${{ inputs.devel }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Get branch name
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v1.36.0
|
||||
|
||||
- name: Save commit message
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-commit-message@v1.36.0
|
||||
|
||||
- name: ci:force flag parser
|
||||
shell: bash
|
||||
run: |
|
||||
skip="false"
|
||||
|
||||
# Get commit message safely from git to avoid script injection
|
||||
if [ "$EVENT_NAME" == "pull_request" ] && [ -n "$PR_HEAD_SHA" ]; then
|
||||
COMMIT_MESSAGE=$(git log -1 --format=%B "$PR_HEAD_SHA" 2>/dev/null || echo "")
|
||||
else
|
||||
COMMIT_MESSAGE=$(git log -1 --format=%B 2>/dev/null || echo "")
|
||||
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.actor }}" == "dependabot[bot]" ]; then
|
||||
echo -e "\033[32mci:force check can be skipped\033[0m"
|
||||
skip_check="true"
|
||||
elif [[ "$COMMIT_MESSAGE" == *"[ci:force]"* ]]; then
|
||||
echo -e "\033[32m[ci:force] flag detected. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [ "$EVENT_NAME" == "schedule" ] || [ "$EVENT_NAME" == "workflow_dispatch" ]; then
|
||||
echo -e "\033[32mSchedule/dispatch event — skipping approval check\033[0m"
|
||||
skip="true"
|
||||
elif [ "$ACTOR" == "dependabot[bot]" ] || [ "$ACTOR" == "alfresco-build" ]; then
|
||||
echo -e "\033[32mCommit by $ACTOR — skipping approval check\033[0m"
|
||||
skip="true"
|
||||
elif echo "$PR_TITLE" | grep -qF "[ci:force]"; then
|
||||
echo -e "\033[32m[ci:force] flag detected in PR title — skipping approval check\033[0m"
|
||||
skip="true"
|
||||
elif echo "$COMMIT_MESSAGE" | grep -qF "[ci:force]"; then
|
||||
echo -e "\033[32m[ci:force] flag detected in commit message — skipping approval check\033[0m"
|
||||
skip="true"
|
||||
elif [[ "$DEVEL_FLAG" == "true" ]]; then
|
||||
echo -e "\033[32mDevel flag — skipping approval check\033[0m"
|
||||
skip="true"
|
||||
fi
|
||||
|
||||
echo "skip=$skip" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get PR number
|
||||
if: ${{ steps.skip-check.outputs.skip != 'true' }}
|
||||
id: pr-number
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
PR_NUMBER="${{ github.event.pull_request.number }}"
|
||||
if [ -z "$PR_NUMBER" ]; then
|
||||
PR_NUMBER=$(gh pr view --json number --jq '.number' 2>/dev/null || echo "")
|
||||
fi
|
||||
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
|
||||
echo "PR: $PR_NUMBER"
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
uses: kamatama41/get-pr-number-action@5c77b38a1b4974ebf8a9521a689f38a5898eadd6
|
||||
id: action
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Check if PR is approved
|
||||
if: ${{ steps.skip-check.outputs.skip != 'true' && steps.pr-number.outputs.pr_number != '' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PR_NUMBER: ${{ steps.pr-number.outputs.pr_number }}
|
||||
- name: show pr number
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Checking approval for PR: $PR_NUMBER"
|
||||
checkApproval=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/reviews | jq '.[] | select(.state == "APPROVED") | .user.login')
|
||||
if [[ $checkApproval ]]; then
|
||||
echo -e "\033[32mPR approved\033[0m"
|
||||
else
|
||||
echo -e "\033[31mPR NOT approved\033[0m"
|
||||
exit 1
|
||||
echo "PR: ${{ steps.action.outputs.number }}"
|
||||
|
||||
- name: check if pr is approved
|
||||
env:
|
||||
DEVEL_FLAG: ${{ inputs.devel }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
skip_check: "false"
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.actor }}" == "dependabot[bot]" ]; then
|
||||
echo -e "\033[32mci:force check can be skipped\033[0m"
|
||||
skip_check="true"
|
||||
elif [[ "$COMMIT_MESSAGE" == *"[ci:force]"* ]]; then
|
||||
echo -e "\033[32m[ci:force] flag detected. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [ "${{ github.actor }}" == "dependabot[bot]" ] || [ "${{ github.actor }}" == "alfresco-build" ]; then
|
||||
echo -e "\033[32mCommit by ${{ github.actor }}. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [ "${{ github.event_name }}" == "schedule" ]; then
|
||||
echo -e "\033[32mSchedule event\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [[ "$DEVEL_FLAG" == "true" ]]; then
|
||||
echo -e "\033[32mDevel flag\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [ "$skip_check" == "false" ]; then
|
||||
echo "Checking PR approval"
|
||||
prNumber=${{ steps.action.outputs.number }}
|
||||
echo "PR: $prNumber"
|
||||
checkApproval=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$prNumber/reviews | jq '.[] | select(.state == "APPROVED") | .user.login')
|
||||
if [[ $checkApproval ]]; then
|
||||
echo -e "\033[32mPR approved\033[0m"
|
||||
else
|
||||
echo -e "\033[31mPR NOT approved\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
setup:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Setup"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-if-pr-is-approved, pre-checks]
|
||||
if: ${{ needs.pre-checks.outputs.code-changed == 'true' }}
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [check-if-pr-is-approved, check-package-lock]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
id: setup-env
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
cache-suffix: setup
|
||||
- name: Bundle
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- name: install
|
||||
run: |
|
||||
pnpm bundle:js-api
|
||||
pnpm bundle:cli
|
||||
- name: Save nx cache
|
||||
if: ${{ success() }}
|
||||
uses: ./.github/actions/save-nx-cache
|
||||
npm ci
|
||||
npx nx run cli:bundle
|
||||
npx nx run testing:bundle
|
||||
- run: npx nx print-affected $NX_CALCULATION_FLAGS
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
unit-tests:
|
||||
timeout-minutes: 30
|
||||
name: "Unit tests: ${{ matrix.unit-tests.name }}"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [setup]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# max-parallel: 4
|
||||
matrix:
|
||||
unit-tests:
|
||||
- name: content-services
|
||||
exclude: "insights,core,extensions,process-services,process-services-cloud,eslint-plugin-eslint-angular"
|
||||
- name: core
|
||||
exclude: "insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular"
|
||||
- name: insights
|
||||
exclude: "core,extensions,content-services,process-services-cloud,process-services,eslint-plugin-eslint-angular"
|
||||
- name: process-services
|
||||
exclude: "core,extensions,content-services,process-services-cloud,insights,eslint-plugin-eslint-angular"
|
||||
- name: process-cloud
|
||||
exclude: "insights,core,extensions,content-services,process-services,eslint-plugin-eslint-angular"
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
cache-suffix: setup
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
/usr/bin/xvfb-run --auto-servernum npx nx affected:test $NX_CALCULATION_FLAGS --exclude=${{ matrix.unit-tests.exclude }}
|
||||
|
||||
lint:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Lint"
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [setup]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
id: setup-env
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
cache-suffix: lint
|
||||
full-setup: 'false'
|
||||
- name: Run lint
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref || 'develop' }}
|
||||
run: pnpm nx affected --target=lint --base=origin/$BASE_REF --head=HEAD
|
||||
- name: Save nx cache
|
||||
if: ${{ success() }}
|
||||
uses: ./.github/actions/save-nx-cache
|
||||
with:
|
||||
cache-suffix: lint
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- run: npx nx affected --target=lint $NX_CALCULATION_FLAGS
|
||||
|
||||
trigger-build:
|
||||
name: "Build Libs"
|
||||
needs: [setup]
|
||||
uses: ./.github/workflows/build-lib-workflow.yml
|
||||
with:
|
||||
base_ref: ${{ github.base_ref || 'develop' }}
|
||||
|
||||
build-storybook:
|
||||
build-libs:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Build Storybook"
|
||||
name: "Build libs"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [setup]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
id: setup-env
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
cache-suffix: storybook
|
||||
full-setup: 'false'
|
||||
- name: Build Storybook
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref || 'develop' }}
|
||||
run: |
|
||||
pnpm nx affected --target=build-storybook --base=origin/$BASE_REF --head=HEAD --configuration=ci
|
||||
- name: Save nx cache
|
||||
if: ${{ success() }}
|
||||
uses: ./.github/actions/save-nx-cache
|
||||
with:
|
||||
cache-suffix: storybook
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- run: npx nx affected:build $NX_CALCULATION_FLAGS --prod
|
||||
- run: npx nx build demoshell --configuration production
|
||||
- run: npx nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration=ci --parallel=1
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
trigger-unit-tests:
|
||||
name: "Unit Tests"
|
||||
needs: [setup]
|
||||
uses: ./.github/workflows/unit-test-workflow.yml
|
||||
secrets:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
base_ref: ${{ github.base_ref || 'develop' }}
|
||||
|
||||
PR-size-check:
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
runs-on: ubuntu-latest
|
||||
e2e-storybook:
|
||||
timeout-minutes: 20
|
||||
name: "e2e: storybook"
|
||||
needs: [build-libs, lint, unit-tests]
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Check PR size
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
script: |
|
||||
const { data: pr } = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
});
|
||||
fetch-depth: 0 # Fetch all history for all
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: Process Cloud Storybook Playwright
|
||||
run: |
|
||||
npx playwright install chromium
|
||||
sudo sysctl -w fs.inotify.max_user_watches=524288
|
||||
npx nx affected --target=e2e-playwright $NX_CALCULATION_FLAGS || exit 1
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
const additions = pr.additions;
|
||||
const deletions = pr.deletions;
|
||||
const totalChanges = additions + deletions;
|
||||
const changedFiles = pr.changed_files;
|
||||
e2e:
|
||||
timeout-minutes: 90
|
||||
name: "e2e: ${{ matrix.e2e-test.description }}"
|
||||
needs: [build-libs, lint, unit-tests]
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# max-parallel: 4
|
||||
matrix:
|
||||
e2e-test:
|
||||
- description: "Core"
|
||||
test-id: "core"
|
||||
folder: "core"
|
||||
provider: "ALL"
|
||||
auth: "OAUTH"
|
||||
check-cs-env: "true"
|
||||
check-ps-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Content: Components"
|
||||
test-id: "content-services"
|
||||
folder: "content-services/components"
|
||||
provider: "ECM"
|
||||
auth: "BASIC"
|
||||
check-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Content: Directives"
|
||||
test-id: "content-services"
|
||||
folder: "content-services/directives"
|
||||
provider: "ECM"
|
||||
auth: "BASIC"
|
||||
check-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Content: Document List"
|
||||
test-id: "content-services"
|
||||
folder: "content-services/document-list"
|
||||
provider: "ECM"
|
||||
auth: "BASIC"
|
||||
check-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Content: Metadata"
|
||||
test-id: "content-services"
|
||||
folder: "content-services/metadata"
|
||||
provider: "ECM"
|
||||
auth: "BASIC"
|
||||
check-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Content: Upload and Versioning"
|
||||
test-id: "content-services"
|
||||
folder: "content-services/upload"
|
||||
provider: "ECM"
|
||||
auth: "BASIC"
|
||||
check-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Search"
|
||||
test-id: "content-services"
|
||||
folder: "search"
|
||||
provider: "ECM"
|
||||
auth: "BASIC"
|
||||
check-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process: Form"
|
||||
test-id: "process-services"
|
||||
folder: "process-services/form"
|
||||
provider: "BPM"
|
||||
auth: "OAUTH"
|
||||
check-ps-env: "true"
|
||||
check-external-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process: Process"
|
||||
test-id: "process-services"
|
||||
folder: "process-services/process"
|
||||
provider: "BPM"
|
||||
auth: "OAUTH"
|
||||
check-ps-env: "true"
|
||||
check-external-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process: Tasks"
|
||||
test-id: "process-services"
|
||||
folder: "process-services/tasks"
|
||||
provider: "BPM"
|
||||
auth: "OAUTH"
|
||||
check-ps-env: "true"
|
||||
check-external-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process: Widget"
|
||||
test-id: "process-services"
|
||||
folder: "process-services/widgets"
|
||||
provider: "BPM"
|
||||
auth: "OAUTH"
|
||||
check-ps-env: "true"
|
||||
check-external-cs-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process Cloud: Form"
|
||||
test-id: "process-services-cloud"
|
||||
folder: "process-services-cloud/form-field"
|
||||
provider: "ALL"
|
||||
auth: "OAUTH"
|
||||
apa-proxy: true
|
||||
check-cs-env: "true"
|
||||
check-ps-cloud-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process Cloud: People"
|
||||
test-id: "process-services-cloud"
|
||||
folder: "process-services-cloud/people"
|
||||
provider: "ALL"
|
||||
auth: "OAUTH"
|
||||
apa-proxy: true
|
||||
check-cs-env: "true"
|
||||
check-ps-cloud-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process Cloud: Process"
|
||||
test-id: "process-services-cloud"
|
||||
folder: "process-services-cloud/process"
|
||||
provider: "ALL"
|
||||
auth: "OAUTH"
|
||||
apa-proxy: true
|
||||
check-cs-env: "true"
|
||||
check-ps-cloud-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process Cloud: Start Task"
|
||||
test-id: "process-services-cloud"
|
||||
folder: "process-services-cloud/start-task"
|
||||
provider: "ALL"
|
||||
auth: "OAUTH"
|
||||
apa-proxy: true
|
||||
check-cs-env: "true"
|
||||
check-ps-cloud-env: "true"
|
||||
deps: "testing"
|
||||
- description: "Process Cloud: Tasks List"
|
||||
test-id: "process-services-cloud"
|
||||
folder: "process-services-cloud/task-list"
|
||||
provider: "ALL"
|
||||
auth: "OAUTH"
|
||||
apa-proxy: true
|
||||
check-cs-env: "true"
|
||||
check-ps-cloud-env: "true"
|
||||
deps: "testing"
|
||||
|
||||
let size = 'S';
|
||||
if (totalChanges > 1000 || changedFiles > 30) size = 'XL';
|
||||
else if (totalChanges > 500 || changedFiles > 20) size = 'L';
|
||||
else if (totalChanges > 200 || changedFiles > 10) size = 'M';
|
||||
|
||||
core.summary
|
||||
.addHeading('PR Size: ' + size, 3)
|
||||
.addTable([
|
||||
[{data: 'Metric', header: true}, {data: 'Count', header: true}],
|
||||
['Files changed', String(changedFiles)],
|
||||
['Additions', '+' + String(additions)],
|
||||
['Deletions', '-' + String(deletions)],
|
||||
['Total changes', String(totalChanges)],
|
||||
]);
|
||||
|
||||
if (size === 'XL') {
|
||||
core.summary.addRaw('⚠️ This PR is very large. Consider splitting it into smaller PRs for easier review.');
|
||||
}
|
||||
|
||||
await core.summary.write();
|
||||
|
||||
if (size === 'XL') {
|
||||
core.warning('This PR has ' + totalChanges + ' changes across ' + changedFiles + ' files. Consider splitting it for easier review.');
|
||||
}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-cache: "true"
|
||||
enable-node-modules-cache: "true"
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: setup chrome
|
||||
uses: ./.github/actions/setup-chrome
|
||||
- name: e2e
|
||||
uses: ./.github/actions/e2e
|
||||
with:
|
||||
e2e-test-id: ${{ matrix.e2e-test.test-id }}
|
||||
e2e-test-folder: ${{ matrix.e2e-test.folder }}
|
||||
e2e-test-provider: ${{ matrix.e2e-test.provider }}
|
||||
e2e-test-auth: ${{ matrix.e2e-test.auth }}
|
||||
check-cs-env: ${{ matrix.e2e-test.check-cs-env }}
|
||||
check-ps-env: ${{ matrix.e2e-test.check-ps-env }}
|
||||
check-ps-cloud-env: ${{ matrix.e2e-test.check-ps-cloud-env }}
|
||||
check-external-cs-env: ${{ matrix.e2e-test.check-external-cs-env }}
|
||||
apa-proxy: ${{ matrix.e2e-test.apa-proxy }}
|
||||
deps: ${{ matrix.e2e-test.deps }}
|
||||
|
||||
PR-forbidden-labels:
|
||||
if: ${{ inputs.cron-run == '' || inputs.cron-run == 'false' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check for forbidden labels
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
- id: checkoutRepo
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: PR contains forbidden labels
|
||||
id: pr-forbidden
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const { data: issue } = await github.rest.issues.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
});
|
||||
const labels = issue.labels?.map(item => item.name) || [];
|
||||
const forbidden = ['next version ➡️', 'do not merge🙅🏻♂️'];
|
||||
const issueHasLabels = require('./scripts/github/update/check-issue-has-label.js');
|
||||
const checkLabels = ['next version ➡️', 'do not merge🙅🏻♂️'];
|
||||
|
||||
if (forbidden.some(l => labels.includes(l))) {
|
||||
const hasLabel = await issueHasLabels({github, context, checkLabels})
|
||||
|
||||
if(hasLabel) {
|
||||
core.setFailed('The PR contains a forbidden label! You are not allowed to merge until the label is there.');
|
||||
}
|
||||
- name: Check value after
|
||||
run: |
|
||||
echo "result ${{ toJson(steps.pr-forbidden.*.result) }}" && echo "result ${{ steps.pr-forbidden.*.result }}"
|
||||
echo "result ${{ contains(toJson(steps.pr-forbidden.*.result), 'failure') }}"
|
||||
|
||||
finalize:
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
name: Final Results
|
||||
needs:
|
||||
[
|
||||
check-if-pr-is-approved,
|
||||
pre-checks,
|
||||
setup,
|
||||
trigger-unit-tests,
|
||||
lint,
|
||||
trigger-build,
|
||||
build-storybook,
|
||||
PR-forbidden-labels,
|
||||
]
|
||||
needs: [check-if-pr-is-approved, check-package-lock, setup, unit-tests, lint, build-libs, e2e, e2e-storybook]
|
||||
steps:
|
||||
- name: Check job execution status
|
||||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
|
||||
- uses: actions/checkout@v3
|
||||
- name: Log e2e result
|
||||
id: e2e-result
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
uses: ./.github/actions/artifact-extract
|
||||
with:
|
||||
artifact-name: global-e2e-result
|
||||
file-name: e2e-failures.txt
|
||||
- name: identify-slack-group
|
||||
id: groups
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
uses: ./.github/actions/slack-group-area
|
||||
with:
|
||||
affected: ${{ steps.e2e-result.outputs.result }}
|
||||
- uses: slackapi/slack-github-action@v1.23.0
|
||||
name: Nofify QA failure
|
||||
if: ${{ github.event_name == 'schedule' && contains(needs.*.result, 'failure') }}
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
with:
|
||||
channel-id: 'C016SMNNL8L' #guild-channel
|
||||
slack-message: "🔴 Warning: The daily ADF cronjob failed\nWorkflow run : <https://github.com/Alfresco/alfresco-ng2-components/actions/runs/${{ github.run_id }}| here>\nDetails: ${{ steps.e2e-result.outputs.result }}\nArea: ${{ steps.groups.outputs.groups}}"
|
||||
- name: workflow failure
|
||||
run: exit 1
|
||||
if: ${{ contains(needs.*.result, 'failure') }}
|
||||
- name: workflow canceled
|
||||
run: exit 1
|
||||
if: ${{ contains(needs.*.result, 'cancelled') }}
|
||||
- name: workflow success
|
||||
run: exit 0
|
||||
if: ${{ contains(needs.*.result, 'success') }}
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8
|
||||
uses: cirrus-actions/rebase@1.8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
name: Release lib on branch
|
||||
run-name: Release lib on branch ${{ github.ref_name }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dry-run on artifact push'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
GITHUB_BRANCH: ${{ github.ref_name }}
|
||||
GH_BUILD_DIR: ${{ github.workspace }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
BUILD_ID: ${{ github.run_id }}
|
||||
GH_RUN_NUMBER: ${{ github.run_attempt }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
JOB_ID: ${{ github.run_id }}
|
||||
PROXY_HOST_BPM: ${{ secrets.E2E_HOST }}
|
||||
E2E_IDENTITY_HOST_APA: ${{ secrets.E2E_IDENTITY_HOST_APA }}
|
||||
E2E_HOST_APA: ${{ secrets.E2E_HOST_APA }}
|
||||
E2E_HOST: ${{ secrets.E2E_HOST }}
|
||||
E2E_USERNAME: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
|
||||
E2E_ADMIN_EMAIL_IDENTITY: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_ADMIN_PASSWORD_IDENTITY: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
#USERNAME_ADF: ${{ secrets.E2E_USERNAME }}
|
||||
USERNAME_ADF: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
PASSWORD_ADF: ${{ secrets.E2E_PASSWORD }}
|
||||
URL_HOST_ADF: "http://localhost:4200"
|
||||
IDENTITY_ADMIN_EMAIL: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
IDENTITY_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
AWS_S3_BUCKET_ACTIVITI_LICENSE: ${{ secrets.AWS_S3_BUCKET_ACTIVITI_LICENSE }}
|
||||
HOST_SSO: ${{ secrets.HOST_SSO }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
E2E_LOG_LEVEL: "ERROR"
|
||||
E2E_MODELER_USERNAME: ${{ secrets.E2E_MODELER_USERNAME }}
|
||||
E2E_MODELER_PASSWORD: ${{ secrets.E2E_MODELER_PASSWORD }}
|
||||
EXTERNAL_ACS_HOST: ${{ secrets.EXTERNAL_ACS_HOST }}
|
||||
E2E_DEVOPS_USERNAME: ${{ secrets.E2E_DEVOPS_USERNAME }}
|
||||
E2E_DEVOPS_PASSWORD: ${{ secrets.E2E_DEVOPS_PASSWORD }}
|
||||
USERNAME_SUPER_ADMIN_ADF: ${{ secrets.USERNAME_SUPER_ADMIN_ADF }}
|
||||
PASSWORD_SUPER_ADMIN_ADF: ${{ secrets.PASSWORD_SUPER_ADMIN_ADF }}
|
||||
HR_USER: ${{ secrets.HR_USER }}
|
||||
HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }}
|
||||
SMART_RUNNER_PATH: ".protractor-smartrunner"
|
||||
S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }}
|
||||
S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }}
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }}
|
||||
DOCKER_REPOSITORY_USER: ${{ secrets.DOCKER_REPOSITORY_USER }}
|
||||
DOCKER_REPOSITORY_PASSWORD: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}
|
||||
DOCKER_REPOSITORY_STORYBOOK: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/storybook"
|
||||
DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell"
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
REPO_OWNER: "Alfresco"
|
||||
REPO_NAME: "alfresco-ng2-components"
|
||||
DEMO_SHELL_DIR: "./dist/demo-shell"
|
||||
STORYBOOK_DIR: "./dist/storybook/stories"
|
||||
BUILT_LIBS_DIR: "./dist/libs"
|
||||
NODE_MODULES_DIR: "./node_modules"
|
||||
SMART_RUNNER_DIRECTORY: ".protractor-smartrunner"
|
||||
SAVE_SCREENSHOT: true
|
||||
REDIRECT_URI: /
|
||||
BROWSER_RUN: false
|
||||
MAXINSTANCES: 2
|
||||
PLAYWRIGHT_WORKERS: 2
|
||||
PLAYWRIGHT_STORYBOOK_E2E_HOST: http://localhost
|
||||
PLAYWRIGHT_STORYBOOK_E2E_PORT: 4400
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
timeout-minutes: 20
|
||||
name: "Setup"
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: set TAG_NPM BRANCH
|
||||
shell: bash
|
||||
run: |
|
||||
TAG_NPM="branch"
|
||||
echo "Set TAG with name: ${TAG_NPM}"
|
||||
echo "TAG_NPM=${TAG_NPM}" >> $GITHUB_ENV
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-cache: false
|
||||
enable-node-modules-cache: false
|
||||
- name: install
|
||||
run: |
|
||||
npm ci
|
||||
npx nx run cli:bundle
|
||||
npx nx run testing:bundle
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
release-npm:
|
||||
needs: [setup]
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-cache: false
|
||||
enable-node-modules-cache: false
|
||||
- id: set-dryrun
|
||||
uses: ./.github/actions/enable-dryrun
|
||||
with:
|
||||
dry-run-flag: ${{ inputs.dry-run-flag }}
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: build libraries
|
||||
run: |
|
||||
set -u;
|
||||
./scripts/update-version.sh -gnu -nextalpha|| exit 1;
|
||||
npx nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache
|
||||
npx nx affected $NX_CALCULATION_FLAGS --target=pretheme
|
||||
- uses: actions/setup-node@v3
|
||||
name: release libraries GH registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
scope: '@alfresco'
|
||||
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=branch|| exit 1
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }}
|
||||
- uses: actions/setup-node@v3
|
||||
name: release libraries Npm registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
|
||||
scope: '@alfresco'
|
||||
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=branch || exit 1
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
||||
|
||||
npm-check-bundle:
|
||||
needs: [release-npm]
|
||||
timeout-minutes: 15
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/npm-check-bundle
|
||||
+160
-109
@@ -1,178 +1,229 @@
|
||||
name: "release"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dry-run on artifact push'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
push:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- develop
|
||||
- develop-patch*
|
||||
- master
|
||||
- master-patch-*
|
||||
|
||||
permissions:
|
||||
id-token: write # Required for OIDC
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
- develop-patch*
|
||||
- master-patch*
|
||||
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
GITHUB_BRANCH: ${{ github.ref_name }}
|
||||
GH_BUILD_DIR: ${{ github.workspace }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
BUILD_ID: ${{ github.run_id }}
|
||||
GH_RUN_NUMBER: ${{ github.run_attempt }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
JOB_ID: ${{ github.run_id }}
|
||||
PROXY_HOST_BPM: ${{ secrets.E2E_HOST }}
|
||||
E2E_IDENTITY_HOST_APA: ${{ secrets.E2E_IDENTITY_HOST_APA }}
|
||||
E2E_HOST_APA: ${{ secrets.E2E_HOST_APA }}
|
||||
E2E_HOST: ${{ secrets.E2E_HOST }}
|
||||
E2E_USERNAME: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
|
||||
E2E_ADMIN_EMAIL_IDENTITY: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
E2E_ADMIN_PASSWORD_IDENTITY: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
#USERNAME_ADF: ${{ secrets.E2E_USERNAME }}
|
||||
USERNAME_ADF: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
PASSWORD_ADF: ${{ secrets.E2E_PASSWORD }}
|
||||
URL_HOST_ADF: "http://localhost:4200"
|
||||
IDENTITY_ADMIN_EMAIL: ${{ secrets.E2E_ADMIN_EMAIL_IDENTITY }}
|
||||
IDENTITY_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD_IDENTITY }}
|
||||
AWS_S3_BUCKET_ACTIVITI_LICENSE: ${{ secrets.AWS_S3_BUCKET_ACTIVITI_LICENSE }}
|
||||
HOST_SSO: ${{ secrets.HOST_SSO }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
E2E_LOG_LEVEL: "ERROR"
|
||||
E2E_MODELER_USERNAME: ${{ secrets.E2E_MODELER_USERNAME }}
|
||||
E2E_MODELER_PASSWORD: ${{ secrets.E2E_MODELER_PASSWORD }}
|
||||
EXTERNAL_ACS_HOST: ${{ secrets.EXTERNAL_ACS_HOST }}
|
||||
E2E_DEVOPS_USERNAME: ${{ secrets.E2E_DEVOPS_USERNAME }}
|
||||
E2E_DEVOPS_PASSWORD: ${{ secrets.E2E_DEVOPS_PASSWORD }}
|
||||
USERNAME_SUPER_ADMIN_ADF: ${{ secrets.USERNAME_SUPER_ADMIN_ADF }}
|
||||
PASSWORD_SUPER_ADMIN_ADF: ${{ secrets.PASSWORD_SUPER_ADMIN_ADF }}
|
||||
HR_USER: ${{ secrets.HR_USER }}
|
||||
HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }}
|
||||
SMART_RUNNER_PATH: ".protractor-smartrunner"
|
||||
S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }}
|
||||
S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }}
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }}
|
||||
DOCKER_REPOSITORY_USER: ${{ secrets.DOCKER_REPOSITORY_USER }}
|
||||
DOCKER_REPOSITORY_PASSWORD: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}
|
||||
DOCKER_REPOSITORY_STORYBOOK: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/storybook"
|
||||
DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell"
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
REPO_OWNER: "Alfresco"
|
||||
REPO_NAME: "alfresco-ng2-components"
|
||||
DEMO_SHELL_DIR: "./dist/demo-shell"
|
||||
STORYBOOK_DIR: "./dist/storybook/stories"
|
||||
BUILT_LIBS_DIR: "./dist/libs"
|
||||
NODE_MODULES_DIR: "./node_modules"
|
||||
SMART_RUNNER_DIRECTORY: ".protractor-smartrunner"
|
||||
SAVE_SCREENSHOT: true
|
||||
REDIRECT_URI: /
|
||||
BROWSER_RUN: false
|
||||
MAXINSTANCES: 2
|
||||
PLAYWRIGHT_WORKERS: 2
|
||||
PLAYWRIGHT_STORYBOOK_E2E_HOST: http://localhost
|
||||
PLAYWRIGHT_STORYBOOK_E2E_PORT: 4400
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
timeout-minutes: 20
|
||||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*'
|
||||
name: "Setup"
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-cache: false
|
||||
enable-node-modules-cache: false
|
||||
- name: install
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm bundle:js-api
|
||||
pnpm bundle:cli
|
||||
npm ci
|
||||
npx nx run cli:bundle
|
||||
npx nx run testing:bundle
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
release-demoshell:
|
||||
needs: [setup]
|
||||
timeout-minutes: 15
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*'
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- run: git fetch --all
|
||||
- id: set-dryrun
|
||||
uses: ./.github/actions/enable-dryrun
|
||||
with:
|
||||
dry-run-flag: ${{ inputs.dry-run-flag }}
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-cache: false
|
||||
enable-node-modules-cache: false
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: release Demoshell docker
|
||||
run: |
|
||||
npx nx build demoshell --configuration production
|
||||
. ./scripts/github/release/docker-tag.sh
|
||||
./scripts/github/release/release-demoshell-docker.sh ${{ steps.set-dryrun.outputs.dryrun }}
|
||||
|
||||
release-storybook:
|
||||
needs: [setup]
|
||||
timeout-minutes: 15
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*'
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- run: git fetch --all
|
||||
- id: set-dryrun
|
||||
uses: ./.github/actions/enable-dryrun
|
||||
with:
|
||||
dry-run-flag: ${{ inputs.dry-run-flag }}
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-cache: false
|
||||
enable-node-modules-cache: false
|
||||
act: ${{ inputs.dry-run-flag }}
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: release Storybook docker
|
||||
run: |
|
||||
npx nx run stories:build-storybook --configuration ci
|
||||
. ./scripts/github/release/docker-tag.sh
|
||||
./scripts/github/release/release-storybook-docker.sh ${{ steps.set-dryrun.outputs.dryrun }}
|
||||
|
||||
release-npm:
|
||||
needs: [setup]
|
||||
outputs:
|
||||
release_version: ${{ steps.set-version.outputs.release_version }}
|
||||
timeout-minutes: 30
|
||||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*'
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
id-token: write # Required for OIDC
|
||||
contents: read
|
||||
packages: write
|
||||
actions: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: setup
|
||||
uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-cache: false
|
||||
enable-node-modules-cache: false
|
||||
- id: set-dryrun
|
||||
uses: ./.github/actions/enable-dryrun
|
||||
with:
|
||||
dry-run-flag: ${{ inputs.dry-run-flag }}
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: Set libraries versions
|
||||
id: set-version
|
||||
- name: build libraries
|
||||
run: |
|
||||
set -u;
|
||||
./scripts/github/build/bumpversion.sh
|
||||
- name: Set migrations
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
const setMigrations = require('./scripts/github/release/set-migrations.js');
|
||||
setMigrations();
|
||||
- name: build libraries
|
||||
run: |
|
||||
pnpm build:libs
|
||||
pnpm build:schematics
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
npx nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache
|
||||
npx nx affected $NX_CALCULATION_FLAGS --target=pretheme
|
||||
- uses: actions/setup-node@v3
|
||||
name: release libraries GH registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
scope: '@alfresco'
|
||||
- run: pnpm run publish --tag ${{ steps.setup.outputs.npm-tag }} --provenance=false ${{ steps.set-dryrun.outputs.dryrun }}
|
||||
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }}
|
||||
- uses: actions/setup-node@v3
|
||||
name: release libraries Npm registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
|
||||
scope: '@alfresco'
|
||||
- run: pnpm run publish --tag ${{ steps.setup.outputs.npm-tag }} ${{ steps.set-dryrun.outputs.dryrun }}
|
||||
|
||||
create-git-tag:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup, release-npm]
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
name: Create github tag
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- uses: './.github/actions/create-git-tag'
|
||||
with:
|
||||
tagName: ${{ needs.release-npm.outputs.release_version }}
|
||||
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
||||
|
||||
npm-check-bundle:
|
||||
needs: [release-npm]
|
||||
timeout-minutes: 25
|
||||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*'
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/npm-check-bundle
|
||||
|
||||
push-translation-keys-to-crowdin:
|
||||
name: Push translations keys to Crowdin
|
||||
if: github.ref_name == 'develop' && github.event_name != 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup]
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Push Source Files to Crowdin
|
||||
uses: crowdin/github-action@0d5670f539973aea2f01abce61a8989934df0025 # v3.0.2
|
||||
with:
|
||||
upload_sources: true
|
||||
upload_sources_args: --delete-obsolete
|
||||
env:
|
||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
|
||||
pull-translation-keys-from-crowdin:
|
||||
needs: push-translation-keys-to-crowdin
|
||||
name: Run Crowdin pull pipeline for up-to-date sync
|
||||
uses: ./.github/workflows/pull-from-crowdin.yml
|
||||
secrets:
|
||||
GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY: ${{ secrets.GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY }}
|
||||
CROWDIN_TRANSLATIONS_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
HXPS_GIT_COMMIT_SIGNING_PRIVATE_KEY: ${{ secrets.HXPS_GIT_COMMIT_SIGNING_PRIVATE_KEY }}
|
||||
|
||||
finalize:
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
name: Final Results
|
||||
needs: [release-npm, npm-check-bundle]
|
||||
steps:
|
||||
- name: Check job execution status
|
||||
if: >-
|
||||
${{
|
||||
contains(needs.*.result, 'failure')
|
||||
|| contains(needs.*.result, 'cancelled')
|
||||
}}
|
||||
run: exit 1
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
name: Final Results
|
||||
needs: [release-demoshell, release-storybook, release-npm, npm-check-bundle]
|
||||
steps:
|
||||
|
||||
- uses: slackapi/slack-github-action@v1.23.0
|
||||
name: Nofify FE hxp-front-end-apps workflow failed
|
||||
if: ${{ contains(toJson(needs.*.result), 'failure') }}
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
with:
|
||||
channel-id: 'C04N93XU491' #hxp-front-end-apps
|
||||
slack-message: "🔴 Warning: The release workflow of alfresco-ng2-components pipe failed\n Author: name:${{ github.event.pusher.name }}\n Workflow run : <https://github.com/Alfresco/alfresco-ng2-components/actions/runs/${{ github.run_id }}| here>\n>"
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
name: "SonarCloud Full Scan (develop)"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
workflow_dispatch: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
full-unit-tests-and-sonar-scan:
|
||||
name: "Full Unit Tests + SonarCloud Scan"
|
||||
uses: ./.github/workflows/unit-test-workflow.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
full: true
|
||||
@@ -1,14 +0,0 @@
|
||||
name: Stale PR Cleanup
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
stale-pr-cleanup:
|
||||
uses: Alfresco/alfresco-build-tools/.github/workflows/stale-pr-cleanup.yml@a297ff6c5bf20c667047db658dd23f60241b270a # v18.28.0
|
||||
@@ -1,31 +0,0 @@
|
||||
name: Supply Chain Review - PR Instructions
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
paths:
|
||||
- "package.json"
|
||||
- "pnpm-lock.yaml"
|
||||
- "**/package.json"
|
||||
- "pom.xml"
|
||||
- "**/pom.xml"
|
||||
|
||||
jobs:
|
||||
instructions:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-upsert-comment@a297ff6c5bf20c667047db658dd23f60241b270a # v18.28.0
|
||||
with:
|
||||
comment-identifier: supply-chain-review-instructions
|
||||
comment-body: |
|
||||
## 🔒 Supply Chain Security
|
||||
|
||||
This PR modifies dependencies. To run a security analysis, comment:
|
||||
|
||||
```
|
||||
/supply-chain-review
|
||||
```
|
||||
|
||||
The analysis will check for vulnerabilities, typosquatting, maintainer takeovers, and other supply chain risks.
|
||||
File diff suppressed because one or more lines are too long
@@ -1,391 +0,0 @@
|
||||
---
|
||||
on:
|
||||
slash_command:
|
||||
name: supply-chain-review
|
||||
reaction: rocket
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
model: gpt-5-mini
|
||||
engine:
|
||||
id: copilot
|
||||
tools:
|
||||
github:
|
||||
toolsets: [context, pull_requests, repos]
|
||||
|
||||
network:
|
||||
allowed:
|
||||
- defaults
|
||||
- node
|
||||
- java
|
||||
- api.osv.dev
|
||||
- api.scorecard.dev
|
||||
- search.maven.org
|
||||
- api.github.com
|
||||
- github.com
|
||||
|
||||
safe-outputs:
|
||||
add-comment:
|
||||
hide-older-comments: true
|
||||
add-labels:
|
||||
allowed: [security:low, security:medium, security:high]
|
||||
issue-intent: false
|
||||
remove-labels:
|
||||
allowed: [security:low, security:medium, security:high]
|
||||
submit-pull-request-review:
|
||||
allowed-events: [COMMENT, REQUEST_CHANGES]
|
||||
supersede-older-reviews: true
|
||||
dismiss-pull-request-review:
|
||||
|
||||
source: Alfresco/alfresco-build-tools/.github/workflows/supply-chain-review.md@599eebd2a1b84e76d540e41036520df3a64c7cbd
|
||||
---
|
||||
|
||||
# Supply Chain Review
|
||||
|
||||
You are a supply chain security analyst reviewing a pull request for dependency changes.
|
||||
Your goal is to identify any dependency additions or upgrades and produce a thorough risk assessment for each change, covering known vulnerabilities, typosquatting, maintainer takeover, install script abuse, version anomalies, source code changes, and project health.
|
||||
|
||||
You are the primary and only analysis engine. There is no secondary check. Be thorough but calibrated: false positives erode trust, but missed threats have severe consequences.
|
||||
|
||||
## Step 1 — Identify Dependency Changes
|
||||
|
||||
Read the **full** pull request diff — every commit in the PR, not just the latest one — and find all modified dependency files (`package.json`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`/`pnpm-lock.yml`, `pnpm-workspace.yaml`/`pnpm-workspace.yml`, `npm-shrinkwrap.json`, `pom.xml`, `build.gradle`, etc.).
|
||||
|
||||
**CRITICAL**: always use the GitHub MCP Server `pull_requests` toolset (e.g. `get_diff` / `get_files`) to fetch the diff — this always reflects every commit in the PR, regardless of local git history, against the correct base branch. Do NOT rely on local git commands or assumptions about the PR's commit history.
|
||||
|
||||
For each changed dependency extract:
|
||||
|
||||
- Package name (including scope/groupId if applicable)
|
||||
- Ecosystem (`npm` or `maven`)
|
||||
- Old version (or mark as `NEW DEPENDENCY` if newly added)
|
||||
- New version
|
||||
|
||||
If no dependency files were changed, post a brief PR comment stating that no dependency changes were detected, then go directly to Step 6 — treating this as LOW risk — to remove any stale `security:*` labels and submit the required pull request review, then stop.
|
||||
|
||||
## Step 1b — Filter Internal Dependencies
|
||||
|
||||
Before collecting external data, identify and exclude internal/private dependencies that cannot be resolved by public APIs.
|
||||
|
||||
**Internal dependency namespaces (skip these):**
|
||||
|
||||
- **Maven**: Any dependency with a `groupId` starting with `com.hyland.`, `org.alfresco.`, or `org.activiti.`
|
||||
- **npm**: Any package under the `@hyland/`, `@hylandsoftware/`, or `@alfresco/` scopes
|
||||
|
||||
For each internal dependency found:
|
||||
|
||||
1. Remove it from the analysis pipeline — do NOT query OSV.dev, OpenSSF Scorecard, or registry APIs for these packages (they will fail or return irrelevant data).
|
||||
2. Record the package name (with `@` replaced by `(at)` for GitHub comment compatibility), ecosystem, old version, and new version in a separate "Internal Dependencies (Skipped)" list.
|
||||
3. Continue with Step 2 only for the remaining external/public dependencies.
|
||||
|
||||
If ALL changed dependencies are internal, skip Steps 2-4 and proceed directly to Step 5 — treating this as LOW risk for Step 6 — posting a report that lists the internal dependencies and notes that no external supply chain analysis was performed.
|
||||
|
||||
## Step 2 — Collect Data for Each Dependency
|
||||
|
||||
For every changed dependency, gather the following data. Fetch all data sources in parallel where possible. If any request fails or returns no data, note it and continue — missing data alone is not proof of malice, but factor it into your confidence level.
|
||||
|
||||
### 2a. Known Vulnerabilities (OSV.dev)
|
||||
|
||||
Query the OSV.dev API for vulnerabilities affecting the **new** version:
|
||||
|
||||
- **npm**: `POST https://api.osv.dev/v1/query` with body `{"package":{"name":"<package-name>","ecosystem":"npm"},"version":"<new-version>"}`
|
||||
- **Maven**: `POST https://api.osv.dev/v1/query` with body `{"package":{"name":"<groupId>:<artifactId>","ecosystem":"Maven"},"version":"<new-version>"}`
|
||||
|
||||
Record all returned vulnerability IDs, severity ratings, and summaries. CRITICAL and HIGH severity CVEs in the new version are the most urgent signal.
|
||||
|
||||
### 2b. OpenSSF Scorecard
|
||||
|
||||
Fetch the project health score. First determine the source repository from the package metadata (see 2c), then query:
|
||||
|
||||
`GET https://api.scorecard.dev/projects/github.com/{owner}/{repo}`
|
||||
|
||||
Record the overall score (0-10) and individual check results. Pay special attention to: Maintained, Code-Review, Vulnerabilities, Branch-Protection, Signed-Releases. A score below 3 is very concerning; below 5 warrants caution. If the package has no linked source repository, the scorecard will be unavailable — this is itself a risk signal.
|
||||
|
||||
### 2c. Package Metadata (Registry)
|
||||
|
||||
**For npm packages**, fetch:
|
||||
|
||||
`GET https://registry.npmjs.org/<package-name>`
|
||||
|
||||
From the full registry document, extract for BOTH the old and new versions:
|
||||
|
||||
- `versions[<version>]._npmUser` — the publisher
|
||||
- `versions[<version>].maintainers` — the maintainer list
|
||||
- `versions[<version>].scripts` — lifecycle scripts (`preinstall`, `install`, `postinstall`)
|
||||
- `versions[<version>].dependencies` — runtime dependencies
|
||||
- `time[<version>]` — publish timestamp
|
||||
- `repository` — source repository URL
|
||||
|
||||
Also extract the `time` object to build a version history (last 10 versions with publish dates).
|
||||
|
||||
**For Maven packages**, fetch:
|
||||
|
||||
`GET https://central.sonatype.com/api/v1/search?q=g:<groupId>+AND+a:<artifactId>&sort=published&limit=10`
|
||||
|
||||
For POM details (build plugins, dependencies): `GET https://repo1.maven.org/maven2/<groupId-as-path>/<artifactId>/<version>/<artifactId>-<version>.pom`
|
||||
|
||||
### 2d. Source Code Diff and Release Notes
|
||||
|
||||
Use the PR diff itself to review the actual file changes for dependency manifest files. Additionally, if a source repository is identified (from 2c), fetch release notes and compare tags:
|
||||
|
||||
- Release notes: `GET https://api.github.com/repos/{owner}/{repo}/releases/tags/v<new-version>` (try with and without the `v` prefix)
|
||||
- For a code-level diff between old and new versions: `GET https://api.github.com/repos/{owner}/{repo}/compare/v<old-version>...v<new-version>` (try with and without the `v` prefix)
|
||||
|
||||
## Step 3 — Analyze Against Threat Taxonomy
|
||||
|
||||
Evaluate each dependency against ALL of the following threat categories. Not every category applies to every package — use judgment.
|
||||
|
||||
### 3a. Known Vulnerabilities
|
||||
|
||||
Assess the severity and exploitability of any CVEs or advisories returned from OSV.dev. CRITICAL and HIGH severity vulnerabilities in the new version are the most urgent signal. Also check whether the upgrade itself fixes known vulnerabilities in the old version (a positive signal).
|
||||
|
||||
### 3b. Typosquatting / Name Confusion
|
||||
|
||||
Determine if the package name could be a typosquatting attempt targeting a well-known package. Consider:
|
||||
|
||||
- Levenshtein distance to popular packages (e.g., `lodas` vs `lodash`)
|
||||
- Dash/underscore/separator swaps (e.g., `my_package` vs `my-package`)
|
||||
- Suffix variants (e.g., `express-js`, `express.js`)
|
||||
- Scope squatting for npm (e.g., `@attacker/lodash` vs `lodash`)
|
||||
- GroupId squatting for Maven (e.g., `org.apach.commons` vs `org.apache.commons`)
|
||||
|
||||
Use your knowledge of the ecosystem to identify plausible targets. Reason from your training data about popular packages.
|
||||
|
||||
### 3c. Maintainer Takeover
|
||||
|
||||
Compare the publisher and maintainer metadata between the old and new versions. Red flags:
|
||||
|
||||
- Publisher changed between versions (different `_npmUser`)
|
||||
- Old maintainers removed and replaced
|
||||
- New publisher has no prior history with the package
|
||||
- Classic pattern: publisher change + maintainer removal (like the event-stream incident)
|
||||
|
||||
### 3d. Install Script Abuse
|
||||
|
||||
**For npm**: Analyze lifecycle scripts (`preinstall`, `install`, `postinstall`) from the registry metadata. Red flags:
|
||||
|
||||
- Scripts that download and execute remote code (`curl`, `wget`, `http://`)
|
||||
- `eval()`, `Function()`, `child_process` usage
|
||||
- Environment variable access (`process.env`) for credential theft
|
||||
- Base64/hex decoding of payloads
|
||||
- Access to sensitive paths (`~/.ssh`, `~/.aws`, `~/.npmrc`, `/etc/passwd`)
|
||||
- Network calls (`dns.lookup`, `net.connect`) for exfiltration
|
||||
- Scripts that are NEW in this version (not present in the old version) are especially suspicious
|
||||
|
||||
**For Maven**: Look for dangerous build plugins in POM changes:
|
||||
|
||||
- `exec-maven-plugin`, `maven-antrun-plugin` with `<exec>`
|
||||
- `<extensions>true</extensions>` on untrusted plugins
|
||||
- Download plugins, Groovy/script plugins
|
||||
|
||||
### 3e. Version Anomalies
|
||||
|
||||
Analyze the version change pattern and history from the registry metadata:
|
||||
|
||||
- Major version jumps (skipping 1+ major versions)
|
||||
- Version downgrade (new version < old version)
|
||||
- Stable to prerelease transition
|
||||
- Very recent publish (less than 48 hours old) — could indicate a rush to distribute malicious code
|
||||
- Rapid successive publishes (many versions in a short window)
|
||||
- Long dormancy then sudden publish (more than 1 year gap) — may indicate account takeover
|
||||
|
||||
### 3f. Source Code Changes
|
||||
|
||||
If source diffs are available (from the GitHub compare API or the PR diff itself), analyze for:
|
||||
|
||||
- Obfuscated code (minified without source maps, hex/unicode escapes, string concatenation to hide function names)
|
||||
- Data exfiltration (network calls sending `process.env`, API keys, tokens to external endpoints)
|
||||
- Filesystem access outside the package directory
|
||||
- Dynamic code execution (`eval()`, `Function()`, `vm.runInNewContext`, `WebAssembly.instantiate`)
|
||||
- Encoded payloads (Base64/hex decoded and executed at runtime)
|
||||
- Inconsistency between release notes and actual changes (changelog says "bug fix" but diff adds network calls)
|
||||
- Cryptocurrency mining patterns
|
||||
- Suspicious new transitive dependencies
|
||||
|
||||
### 3g. Project Health
|
||||
|
||||
Interpret the OpenSSF Scorecard data:
|
||||
|
||||
- Overall score below 3/10 is very concerning
|
||||
- Score below 5/10 warrants caution
|
||||
- Pay attention to specific failing checks: Maintained, Code-Review, Vulnerabilities, Branch-Protection, Signed-Releases
|
||||
- Missing scorecard data (no source repo linked) is itself a risk signal
|
||||
|
||||
### 3h. Missing Source Repository
|
||||
|
||||
A package with no linked source repository prevents code audit and is a risk signal, especially combined with other concerns.
|
||||
|
||||
### 3i. Tag Poisoning / Build Provenance
|
||||
|
||||
Evaluate whether the published artifact can be traced back to a verified source commit. This category covers attacks where a legitimate-looking version tag is manipulated to distribute malicious code.
|
||||
|
||||
#### Tag-to-Registry Provenance Mismatch
|
||||
|
||||
Check whether the git tag for the new version corresponds to the published artifact:
|
||||
|
||||
- Compare the tag commit date with the registry publish timestamp. A discrepancy of more than a few hours (allowing for CI/CD pipeline time) is suspicious.
|
||||
- If the source diff between the tag and the previous tag includes changes not documented in release notes, flag as suspicious.
|
||||
|
||||
#### Mutable/Moved Tags
|
||||
|
||||
Check if the tag appears to have been recreated:
|
||||
|
||||
- Use `GET https://api.github.com/repos/{owner}/{repo}/git/refs/tags/{tag}` to get the tag reference.
|
||||
- For annotated tags, use `GET https://api.github.com/repos/{owner}/{repo}/git/tags/{sha}` to check the tag object and its `tagger.date`.
|
||||
- If the tag creation date is significantly newer than the commit it points to (e.g., more than 7 days), this may indicate the tag was deleted and recreated pointing to a different commit.
|
||||
|
||||
#### Unsigned Tags
|
||||
|
||||
Determine tag type and signing status:
|
||||
|
||||
- **Annotated + signed tags** (GPG or SSH signature present) — strongest integrity signal.
|
||||
- **Annotated but unsigned tags** — moderate integrity; the tag is immutable but unverified.
|
||||
- **Lightweight tags** — weakest integrity; easily moved without trace. Flag as a risk signal for high-profile or security-critical packages.
|
||||
|
||||
For the tag object, check the `verification` field in the GitHub API response for signature status.
|
||||
|
||||
#### Build Provenance / Attestation
|
||||
|
||||
Check for SLSA provenance attestations or Sigstore signatures:
|
||||
|
||||
**For npm packages**: Query `GET https://registry.npmjs.org/-/npm/v1/attestations/<package-name>@<new-version>`. If attestations are present, verify:
|
||||
|
||||
- The `predicateType` matches a known SLSA provenance type
|
||||
- The `subject` digest matches the published package tarball
|
||||
- The build was performed by a trusted CI system (e.g., GitHub Actions)
|
||||
|
||||
**For Maven packages**: Check if Sigstore `.sigstore` bundle files exist alongside the artifact at:
|
||||
`GET https://repo1.maven.org/maven2/<groupId-as-path>/<artifactId>/<version>/<artifactId>-<version>.jar.sigstore`
|
||||
|
||||
The absence of provenance attestations on a high-profile package (>1000 weekly downloads for npm, or widely used in the ecosystem) is a moderate risk signal. Packages that previously published with provenance but stopped doing so are especially suspicious.
|
||||
|
||||
#### Tag Mimicry on Forks
|
||||
|
||||
Verify that the source repository URL in registry metadata points to the canonical repository:
|
||||
|
||||
- Cross-reference the `repository` field from package metadata (Step 2c) with the GitHub API response.
|
||||
- If the repository URL points to a fork rather than the original project, flag as HIGH risk — this may indicate a hijacked tag on a lookalike fork.
|
||||
- Check that the repository owner matches known maintainers of the package.
|
||||
|
||||
## Step 4 — Score and Classify Risk
|
||||
|
||||
Assign a risk score (0-100) to each dependency using these guidelines:
|
||||
|
||||
| Priority | Signal | Typical Impact |
|
||||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
|
||||
| Highest | Known CRITICAL/HIGH CVEs in new version, confirmed typosquatting, malicious code in diff, build provenance mismatch (tag points to different code than published artifact), tag mimicry on fork | 60+ points |
|
||||
| High | Maintainer takeover pattern (publisher changed + old maintainers removed), dangerous install scripts, known compromised package, moved/recreated tag with different commit, provenance attestations removed from package that previously had them | 20-40 points |
|
||||
| Medium | Low OpenSSF Scorecard (< 3), publisher changed (without full takeover), new install scripts, very recent publish (< 48h), obfuscated code in diff, unsigned lightweight tags on security-critical packages, absence of provenance on high-profile packages | 10-20 points |
|
||||
| Lower | Scorecard 3-5, version anomalies, missing source repository, long dormancy, rapid publishes, tag date slightly newer than commit (within 7 days), annotated but unsigned tags | 5-10 points |
|
||||
|
||||
These are guidelines, not rigid formulas. Use judgment to combine signals — multiple medium signals can compound into a high-risk assessment.
|
||||
|
||||
**Risk level thresholds**: 0-20 = LOW, 21-50 = MEDIUM, 51-80 = HIGH, 81-100 = CRITICAL.
|
||||
|
||||
If no suspicious patterns are found, assign a score of 0-10 and risk level LOW. Most legitimate upgrades should score LOW.
|
||||
|
||||
## Step 5 — Post Findings as PR Comment
|
||||
|
||||
Post a structured report in the following format.
|
||||
|
||||
**CRITICAL: Sanitize all `@` symbols before posting**
|
||||
|
||||
GitHub enforces a maximum of 10 mentions per comment. Package names containing `@` (like `@hyland/core`, `@alfresco/js-api`) are interpreted as user/team mentions and trigger this limit, causing comment post failures.
|
||||
|
||||
**Before generating the comment text**:
|
||||
|
||||
1. Replace **every** `@` symbol in package names with `(at)` — e.g., `@hyland/core` → `(at)hyland/core`
|
||||
2. Apply this transformation to ALL occurrences: table cells, headings, inline code blocks, findings sections, reason columns
|
||||
3. This applies to both external and internal dependencies
|
||||
4. Do NOT skip this step — even if only a few packages are affected, GitHub counts all `@` symbols
|
||||
|
||||
```txt
|
||||
## Supply Chain Security Review
|
||||
|
||||
| Package | Ecosystem | Old Version | New Version | Risk Score | Risk Level |
|
||||
|---------|-----------|-------------|-------------|------------|------------|
|
||||
| example | npm | 1.0.0 | 2.0.0 | 5 | LOW |
|
||||
|
||||
### Internal Dependencies (Skipped)
|
||||
|
||||
| Package | Ecosystem | Old Version | New Version | Reason |
|
||||
|-----------------|-----------|-------------|-------------|-------------------------------|
|
||||
| (at)hyland/core | npm | 3.1.0 | 3.2.0 | Internal ((at)hyland/* scope) |
|
||||
|
||||
_These dependencies are internal packages not available on public registries. External API checks were skipped._
|
||||
|
||||
### Findings
|
||||
|
||||
#### `<package-name-sanitized>` (<old-version> -> <new-version>) — <RISK_LEVEL>
|
||||
|
||||
**Risk Score**: <score>/100
|
||||
|
||||
<If findings exist, list each one:>
|
||||
|
||||
**<Category>** (<severity>) — <title>
|
||||
<detailed explanation with specific evidence>
|
||||
|
||||
<If no findings:>
|
||||
No suspicious patterns detected. Routine upgrade.
|
||||
|
||||
---
|
||||
|
||||
### Data Collection Notes
|
||||
|
||||
<List any APIs that were unavailable or returned errors, so reviewers know what was and wasn't checked.>
|
||||
|
||||
---
|
||||
|
||||
### Overall Risk: <highest risk level across all dependencies>
|
||||
|
||||
**Recommendation**: <approve|review|block>
|
||||
- **approve**: LOW risk, routine upgrade, no concerns found
|
||||
- **review**: MEDIUM risk, a human should examine specific findings before merging
|
||||
- **block**: HIGH/CRITICAL risk, should not be merged without security team review
|
||||
```
|
||||
|
||||
## Step 6 — Apply Label and Review Status
|
||||
|
||||
### 6a. Labels — order-independent update
|
||||
|
||||
Determine the single target label for the highest risk level found: `security:low`, `security:medium`, or `security:high`.
|
||||
|
||||
- Remove only the OTHER `security:*` labels (the ones that do NOT match the target) if present on the PR — this clears stale risk labels left by a previous review (e.g., after a new commit changed the risk level).
|
||||
- Add the target label if it is not already present.
|
||||
- **Never remove the target label itself.** Because the remove and add operations act on disjoint labels, the final state is correct regardless of which of the two safe-output calls (`add_labels` / `remove_labels`) happens to be processed first — do NOT rely on emitting them in a particular order, since that ordering is not guaranteed. (Do not, for example, remove all three `security:*` labels and then add the target back — if the removal is processed after the add, the target label would be stripped again, leaving the PR with no risk label at all.)
|
||||
|
||||
### 6b. Dismiss stale reviews from this workflow
|
||||
|
||||
Every review this workflow posts (see 6c) MUST start its body with the exact literal marker line `**Supply Chain Review**` as the first line, so future runs can recognize their own prior reviews.
|
||||
|
||||
Before posting the new review:
|
||||
|
||||
1. Fetch the PR's existing reviews (GitHub MCP `pull_requests` toolset).
|
||||
2. Identify any review that is authored by this workflow's actor AND whose body starts with the `**Supply Chain Review**` marker AND is still in the `CHANGES_REQUESTED` state — that is a stale review from an earlier run of this same workflow (e.g., posted before the flagged dependency was fixed, downgraded, or removed).
|
||||
3. For each such review, call `dismiss_pull_request_review` with its explicit numeric `review_id` (do NOT use `'auto'` — this repository may run other agentic workflows that also post as the same actor, and `'auto'` would dismiss their reviews too) and a justification of at least 20 characters (e.g., "Superseded by a newer Supply Chain Review run.").
|
||||
|
||||
Do this even though `submit-pull-request-review` is also configured with `supersede-older-reviews: true` — that setting is best-effort and may not always recognize the prior review, so the explicit dismissal above is the reliable mechanism and must always be attempted.
|
||||
|
||||
### 6c. Submit the review
|
||||
|
||||
**Always submit a pull request review — in every invocation, with no exceptions.** This is not conditional on risk level. Submit a review even when there are no dependency changes, when all dependencies are internal, or when risk is LOW — skipping it would mean a stale `REQUEST_CHANGES` review from an earlier run is never replaced or dismissed.
|
||||
|
||||
The review body must start with the `**Supply Chain Review**` marker line (see 6b), followed by the assessment:
|
||||
|
||||
- If the highest risk level is HIGH or CRITICAL, submit the review as **request changes**, with a summary of the critical findings.
|
||||
- If the risk is MEDIUM, submit the review as a **comment**, noting that human review is recommended.
|
||||
- If the risk is LOW (including when there are no dependency changes, or all changed dependencies are internal), submit the review as a **comment**, summarizing that no concerns were found and the PR comment has the full detail.
|
||||
- **Never submit the review as an approval, under any circumstance** — this workflow only ever comments or requests changes; a human always makes the merge decision.
|
||||
|
||||
## Important Guidelines
|
||||
|
||||
- **Never approve or merge the PR** — all actions are advisory or blocking only. A human always makes the merge decision. Every review this workflow submits must use the comment or request-changes event — never the approve event.
|
||||
- **Always submit exactly one pull request review per invocation, regardless of outcome**, and always prefix its body with the `**Supply Chain Review**` marker — this is required so that a later run of this same workflow can find and dismiss it via `dismiss_pull_request_review` once it becomes stale (see Step 6b). Do not rely on `supersede-older-reviews` alone; it is best-effort.
|
||||
- **Never remove the `security:*` label matching the current risk level** when clearing stale labels — only remove the other ones, so the final label state is correct no matter which safe-output call is processed first (see Step 6a).
|
||||
- Be specific in findings — cite exact data (vulnerability ID, maintainer name, script content, file path, API response) rather than vague warnings.
|
||||
- For Maven packages, adapt npm-specific checks appropriately (e.g., install scripts become build plugin analysis, maintainer metadata may be limited).
|
||||
- When a package is a NEW dependency (no old version), pay extra attention to project health, name legitimacy, and install scripts since there is no historical baseline to compare against.
|
||||
- If data collection fails for all external APIs, still analyze the PR diff directly and provide the best assessment you can with available information, noting the limitations clearly.
|
||||
- For tag poisoning checks, not all packages will have provenance attestations — this is still an emerging practice. Weight the absence of attestations proportionally to the package's profile and criticality. Do not flag low-download utility packages for missing provenance.
|
||||
- When checking tag dates, allow for reasonable CI/CD pipeline delays (up to a few hours between tag push and publish). Only flag significant discrepancies (days or weeks).
|
||||
@@ -1,144 +0,0 @@
|
||||
name: "Unit Tests Workflow"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
SONAR_TOKEN:
|
||||
description: 'Token for SonarCloud analysis'
|
||||
required: false
|
||||
inputs:
|
||||
base_ref:
|
||||
description: 'Base branch for affected calculation'
|
||||
required: false
|
||||
type: string
|
||||
default: 'develop'
|
||||
full:
|
||||
description: 'Run the full (non-affected) test suite for every project instead of only affected ones'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
generate-affected-matrix:
|
||||
name: "Generate affected matrix"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
unitMatrix: ${{ steps.set-matrix.outputs.unitMatrix }}
|
||||
hasProjects: ${{ steps.set-matrix.outputs.hasProjects }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
id: setup-env
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
cache-suffix: test-matrix
|
||||
- name: Generate affected projects matrix
|
||||
id: set-matrix
|
||||
env:
|
||||
BASE_REF: ${{ inputs.base_ref }}
|
||||
FULL_RUN: ${{ inputs.full }}
|
||||
run: |
|
||||
if [ "$FULL_RUN" == "true" ]; then
|
||||
echo "Running full (non-affected) test suite"
|
||||
AFFECTED_UNIT=$(pnpm nx show projects --target=test --select=projects --plain --exclude=cli,stories,eslint-angular)
|
||||
else
|
||||
echo "Base ref is $BASE_REF"
|
||||
AFFECTED_UNIT=$(pnpm nx show projects --affected --target=test --base=origin/$BASE_REF --head=HEAD --select=projects --plain --exclude=cli,stories,eslint-angular)
|
||||
fi
|
||||
echo "Affected projects for UNIT: $AFFECTED_UNIT"
|
||||
|
||||
if [ -z "$AFFECTED_UNIT" ]; then
|
||||
echo "No affected projects found"
|
||||
echo "hasProjects=false" >> $GITHUB_OUTPUT
|
||||
echo "unitMatrix=[]" >> $GITHUB_OUTPUT
|
||||
else
|
||||
UNIT_MATRIX_JSON=$(echo "$AFFECTED_UNIT" | xargs -n1 | jq -R -s -c 'split("\n") | map(select(length > 0)) | map({ "project": . })')
|
||||
echo "Matrix UNIT: $UNIT_MATRIX_JSON"
|
||||
echo "hasProjects=true" >> $GITHUB_OUTPUT
|
||||
echo "unitMatrix=$UNIT_MATRIX_JSON" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Save nx cache
|
||||
if: ${{ success() }}
|
||||
uses: ./.github/actions/save-nx-cache
|
||||
with:
|
||||
cache-suffix: test-matrix
|
||||
|
||||
unit-tests:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
needs: generate-affected-matrix
|
||||
if: ${{ needs.generate-affected-matrix.outputs.hasProjects == 'true' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.generate-affected-matrix.outputs.unitMatrix) }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Setup environment
|
||||
id: setup-env
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
cache-suffix: test-${{ matrix.project }}
|
||||
full-setup: 'false'
|
||||
- name: Run unit tests for ${{ matrix.project }}
|
||||
env:
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
run: |
|
||||
xvfb-run --auto-servernum pnpm nx run ${{ matrix.project }}:test
|
||||
- name: Upload coverage report
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: coverage-${{ matrix.project }}
|
||||
path: coverage/${{ matrix.project }}/lcov.info
|
||||
if-no-files-found: ignore
|
||||
retention-days: 1
|
||||
- name: Save nx cache
|
||||
if: ${{ success() }}
|
||||
uses: ./.github/actions/save-nx-cache
|
||||
with:
|
||||
cache-suffix: test-${{ matrix.project }}
|
||||
|
||||
sonarcloud:
|
||||
name: "SonarCloud Scan"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [generate-affected-matrix, unit-tests]
|
||||
if: ${{ needs.generate-affected-matrix.outputs.hasProjects == 'true' && always() && needs.unit-tests.result != 'cancelled' }}
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download all coverage artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: coverage-*
|
||||
path: coverage-reports
|
||||
- name: Merge coverage reports
|
||||
run: |
|
||||
mkdir -p coverage
|
||||
echo "Artifact structure:"
|
||||
find coverage-reports -type f -name 'lcov.info' 2>/dev/null || true
|
||||
for dir in coverage-reports/coverage-*/; do
|
||||
project_name=$(basename "$dir" | sed 's/^coverage-//')
|
||||
lcov_file=$(find "$dir" -name 'lcov.info' -type f | head -1)
|
||||
if [ -n "$lcov_file" ]; then
|
||||
mkdir -p "coverage/${project_name}"
|
||||
cp "$lcov_file" "coverage/${project_name}/lcov.info"
|
||||
echo "Copied coverage for ${project_name}"
|
||||
fi
|
||||
done
|
||||
echo "Coverage files found:"
|
||||
find coverage -name 'lcov.info' -type f
|
||||
- name: SonarCloud Scan
|
||||
uses: SonarSource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f # v8.2.1
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: https://sonarcloud.io
|
||||
@@ -0,0 +1,214 @@
|
||||
name: Upstream js
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 */3 * * *' # “At minute 0 past every 3rd hour.”
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag_version:
|
||||
description: image tag
|
||||
type: choice
|
||||
required: true
|
||||
options:
|
||||
- alpha
|
||||
- latest
|
||||
default: alpha
|
||||
|
||||
jobs:
|
||||
upstream:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
hasAtLeastOneNewVersion: ${{ steps.fetchLatestPkg.outputs.hasAtLeastOneNewVersion }}
|
||||
hasNewVersionAvailableJS: ${{ steps.fetchLatestPkg.outputs.hasVersionNewJS }}
|
||||
latestVersionAvailableJS: ${{ steps.fetchLatestPkg.outputs.latestVersionJS }}
|
||||
hasAtLeastOneNewVersionWithoutPR: ${{ steps.checkPrAlreadyExist.outputs.hasAtLeastOneNewVersionWithoutPR }}
|
||||
steps:
|
||||
- id: checkoutRepo
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- id: fetchLatestPkg
|
||||
name: Fetch the latest package version
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
TAG_VERSION: ${{ inputs.tag_version }}
|
||||
with:
|
||||
github-token: ${{ secrets.PAT_WRITE_PKG }}
|
||||
script: |
|
||||
const tagVersion = process.env.TAG_VERSION;
|
||||
console.log('tagVersion:',tagVersion);
|
||||
const getLatestVersionOf = require('./scripts/github/update/latest-version-of.js');
|
||||
|
||||
const { hasVersionNew: hasVersionNewJS, latestVersion: latestVersionJS } = await getLatestVersionOf({github, context, dependencyName: 'js-api', tagVersion});
|
||||
console.log('hasVersionNewJS', hasVersionNewJS)
|
||||
console.log('latestVersionJS', latestVersionJS)
|
||||
|
||||
if (hasVersionNewJS === 'true' ) {
|
||||
core.setOutput('hasAtLeastOneNewVersion', 'true');
|
||||
core.setOutput('hasVersionNewJS', 'true');
|
||||
core.setOutput('latestVersionJS', latestVersionJS);
|
||||
} else {
|
||||
core.setOutput('hasAtLeastOneNewVersion', 'false');
|
||||
console.log('No new version available, skipping upstream!')
|
||||
}
|
||||
|
||||
- name: Check value after
|
||||
run: |
|
||||
echo "The value hasAtLeastOneNewVersion is: ${{ steps.fetchLatestPkg.outputs.hasAtLeastOneNewVersion }}"
|
||||
echo "The value hasVersionNewJS is: ${{ steps.fetchLatestPkg.outputs.hasVersionNewJS }}"
|
||||
echo "The value latestVersionJS is: ${{ steps.fetchLatestPkg.outputs.latestVersionJS }}"
|
||||
|
||||
- id: checkPrAlreadyExist
|
||||
name: Check PR with latest already exist
|
||||
if: ${{ steps.fetchLatestPkg.outputs.hasAtLeastOneNewVersion == 'true' }}
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
HAS_NEW_JS_VERSION: ${{ steps.fetchLatestPkg.outputs.hasVersionNewJS }}
|
||||
LATEST_JS_VERSION: ${{ steps.fetchLatestPkg.outputs.latestVersionJS }}
|
||||
with:
|
||||
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const hasVersionNewJS = process.env.HAS_NEW_JS_VERSION;
|
||||
const latestVersionJS = process.env.LATEST_JS_VERSION;
|
||||
|
||||
const checkPRAlreadyExist = require('./scripts/github/update/check-pr-already-exist.js');
|
||||
let isPRWithLatestJSAlreadyAvailable = false;
|
||||
|
||||
if (hasVersionNewJS === 'true') {
|
||||
isPRWithLatestJSAlreadyAvailable = await checkPRAlreadyExist({github, context, version: latestVersionJS});
|
||||
console.log('isPRWithLatestJSAlreadyAvailable', isPRWithLatestJSAlreadyAvailable);
|
||||
}
|
||||
|
||||
if (isPRWithLatestJSAlreadyAvailable) {
|
||||
console.log('Warning: Upstream PR already exist, stop the migration execution!');
|
||||
core.setOutput('hasAtLeastOneNewVersionWithoutPR', 'false');
|
||||
} else {
|
||||
core.setOutput('hasAtLeastOneNewVersionWithoutPR', 'true');
|
||||
}
|
||||
|
||||
migrate:
|
||||
if: ${{ needs.upstream.outputs.hasAtLeastOneNewVersionWithoutPR == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: upstream
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
fetch-depth: 1
|
||||
- name: setup NPM
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: "General :: dbpci-install"
|
||||
run: |
|
||||
npm ci --ignore-scripts
|
||||
- name: Migration
|
||||
shell: bash
|
||||
env:
|
||||
IS_JS_AFFECTED: ${{ needs.upstream.outputs.hasNewVersionAvailableJS }}
|
||||
PACKAGE_VERSION_JS: ${{ needs.upstream.outputs.latestVersionAvailableJS }}
|
||||
BRANCH_TO_CREATE: "upstream-dependencies"
|
||||
run: |
|
||||
|
||||
migrateDependenciesJS() {
|
||||
echo "Update JS dependencies to: ${PACKAGE_VERSION_JS}"
|
||||
echo "Calling migration JS"
|
||||
npx nx migrate @alfresco/js-api@${PACKAGE_VERSION_JS}
|
||||
echo "Migration JS done"
|
||||
}
|
||||
|
||||
migrateLibDependenciesJS() {
|
||||
eval projects=( "cli"
|
||||
"core"
|
||||
"content-services"
|
||||
"process-services"
|
||||
"process-services-cloud"
|
||||
"insights"
|
||||
"testing"
|
||||
"extensions" )
|
||||
|
||||
projectslength=${#projects[@]}
|
||||
for (( i=0; i<${projectslength}; i++ ));
|
||||
do
|
||||
echo "Update JS dependencies in adf-${projects[$i]} to: ${PACKAGE_VERSION_JS}"
|
||||
DESTDIR="lib/${projects[$i]}"
|
||||
sed -i "${sedi[@]}" "s/\"@alfresco\/js-api\": \".*\"/\"@alfresco\/js-api\": \">=${PACKAGE_VERSION_JS}\"/g" ${DESTDIR}/package.json
|
||||
done
|
||||
}
|
||||
|
||||
regeneratePackageLock() {
|
||||
echo "Regenerate lock"
|
||||
npm i --package-lock-only
|
||||
echo "Package-lock done."
|
||||
}
|
||||
|
||||
if git checkout ${BRANCH_TO_CREATE} 2>/dev/null ; then
|
||||
git reset --hard origin/develop
|
||||
echo "Reset branch"
|
||||
fi
|
||||
|
||||
if [[ "$IS_JS_AFFECTED" == "true" ]]; then
|
||||
migrateDependenciesJS
|
||||
migrateLibDependenciesJS
|
||||
fi
|
||||
|
||||
regeneratePackageLock
|
||||
|
||||
- name: Commit Code
|
||||
if: ${{ needs.upstream.outputs.hasAtLeastOneNewVersion == 'true' }}
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: "[ci:force][auto-commit] Update dependencies JS:${{ needs.upstream.outputs.latestVersionAvailableJS }}"
|
||||
branch: upstream-dependencies
|
||||
push_options: '--force'
|
||||
create_branch: true
|
||||
|
||||
- name: Create a Pull request
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
PACKAGE_VERSION_JS: ${{ needs.upstream.outputs.latestVersionAvailableJS }}
|
||||
with:
|
||||
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { PACKAGE_VERSION_JS } = process.env
|
||||
const BRANCH_TO_CREATE = 'upstream-dependencies';
|
||||
|
||||
const { data: prs } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
head: `${context.repo.owner}:${BRANCH_TO_CREATE}`,
|
||||
base: 'develop'
|
||||
});
|
||||
|
||||
if (prs.length < 1) {
|
||||
const payloadPullRequest = {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
title: `GH Auto: Upstream dependencies JS-API:${PACKAGE_VERSION_JS}`,
|
||||
head: `${context.repo.owner}:${BRANCH_TO_CREATE}`,
|
||||
base: 'develop',
|
||||
body: `Automatic PR`
|
||||
};
|
||||
|
||||
console.log('Payload: ',payloadPullRequest);
|
||||
|
||||
const { data: pr } = await github.rest.pulls.create(payloadPullRequest);
|
||||
return pr.number;
|
||||
} else {
|
||||
const upstreamPrOpen = prs[0];
|
||||
|
||||
// override the title to contains the latest js dep number
|
||||
const payloadUpdatePullRequest = {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: upstreamPrOpen.number,
|
||||
title: `GH Auto: Upstream dependencies JS-API:${PACKAGE_VERSION_JS}`,
|
||||
};
|
||||
|
||||
await github.rest.pulls.update(payloadUpdatePullRequest);
|
||||
return upstreamPrOpen.number;
|
||||
}
|
||||
console.log(`Trigger a dispatch event for the monorepo`);
|
||||
+18
-7
@@ -1,26 +1,37 @@
|
||||
/.angular/cache
|
||||
*.log
|
||||
node_modules
|
||||
bundles
|
||||
workspace.xml
|
||||
.idea/
|
||||
*.iml
|
||||
.env.*
|
||||
.env
|
||||
dist
|
||||
!./.github/actions/**/dist
|
||||
e2e/.env.cloud
|
||||
tmp
|
||||
temp
|
||||
/nxcache
|
||||
e2e-output*/
|
||||
/e2e/downloads/
|
||||
*.npmrc
|
||||
.history
|
||||
/ng2-components/ng2-alfresco-core/prebuilt-themes/
|
||||
.ng_pkg_build/
|
||||
/demo-shell/dist-dev-temp/
|
||||
/lib/export-new.json
|
||||
/lib/config/exportCheck.js
|
||||
/docs/sourceinfo
|
||||
/docs/docs.json
|
||||
/protractorFailuresReport
|
||||
coverage/
|
||||
/desktop.ini
|
||||
out-tsc
|
||||
!/.protractor-smartrunner/
|
||||
/reports/
|
||||
e2e-result-*
|
||||
licenses.txt
|
||||
.DS_Store
|
||||
desktop.ini
|
||||
.angular
|
||||
.nx
|
||||
nxcache
|
||||
.husky
|
||||
.cursor/rules/nx-rules.mdc
|
||||
.github/instructions/nx.instructions.md
|
||||
lib/eslint-angular/dist/
|
||||
NX
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
export NODE_OPTIONS=--max_old_space_size=8192
|
||||
|
||||
lint-staged
|
||||
npm run affected:lint
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"*.{ts,js}": ["prettier --write", "eslint"],
|
||||
"*.{css,scss}": ["prettier --write", "stylelint --fix"]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
# Fail on high severity vulnerabilities during audit
|
||||
audit-level=high
|
||||
|
||||
# Use exact versions to prevent unexpected updates
|
||||
save-exact=true
|
||||
@@ -0,0 +1,9 @@
|
||||
import { create } from '@storybook/theming';
|
||||
import alfrescoLogo from '../lib/core/src/lib/assets/images/alfresco-logo.svg';
|
||||
|
||||
export default create({
|
||||
base: 'light',
|
||||
brandTitle: 'Hyland | Alfresco Storybook App',
|
||||
brandUrl: 'https://www.alfresco.com/',
|
||||
brandImage: alfrescoLogo,
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
stories: [],
|
||||
addons: ['@storybook/addon-essentials'],
|
||||
framework: '@storybook/angular',
|
||||
staticDirs: [ { from: '../../../demo-shell/src/app.config.json', to: 'app.config.json' } ],
|
||||
core: { builder: 'webpack5' }
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import type { StorybookConfig } from '@storybook/angular';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
framework: {
|
||||
name: getAbsolutePath('@storybook/angular'),
|
||||
options: {}
|
||||
},
|
||||
staticDirs: [],
|
||||
stories: ['lib/**/*.stories.ts'],
|
||||
features: {
|
||||
backgrounds: false
|
||||
},
|
||||
core: {
|
||||
disableTelemetry: true
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
function getAbsolutePath(value: string): any {
|
||||
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export const parameters = {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
import type { Preview } from '@storybook/angular';
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
},
|
||||
tags: ['autodocs']
|
||||
};
|
||||
|
||||
export default preview;
|
||||
@@ -1,71 +0,0 @@
|
||||
{
|
||||
"extends": ["stylelint-config-standard-scss"],
|
||||
"rules": {
|
||||
"custom-property-pattern": [
|
||||
"^(mat-sys|mdc)",
|
||||
{
|
||||
"message": "Use only Angular Material system variables (--mat-sys-*, --mdc-*)"
|
||||
}
|
||||
],
|
||||
"color-function-notation": "legacy",
|
||||
"alpha-value-notation": "number",
|
||||
"color-no-invalid-hex": true,
|
||||
"function-calc-no-unspaced-operator": true,
|
||||
"function-name-case": "lower",
|
||||
"function-url-quotes": "always",
|
||||
"function-url-scheme-disallowed-list": [
|
||||
"data"
|
||||
],
|
||||
"length-zero-no-unit": true,
|
||||
"string-no-newline": true,
|
||||
"unit-no-unknown": true,
|
||||
"unit-allowed-list": [
|
||||
"px",
|
||||
"%",
|
||||
"deg",
|
||||
"ms",
|
||||
"em",
|
||||
"vh",
|
||||
"vw",
|
||||
"vmin",
|
||||
"s",
|
||||
"rem"
|
||||
],
|
||||
"shorthand-property-no-redundant-values": true,
|
||||
"declaration-no-important": true,
|
||||
"no-duplicate-at-import-rules": true,
|
||||
"declaration-block-no-duplicate-properties": [
|
||||
true,
|
||||
{
|
||||
"ignore": [
|
||||
"consecutive-duplicates-with-different-values"
|
||||
]
|
||||
}
|
||||
],
|
||||
"declaration-block-single-line-max-declarations": 1,
|
||||
"declaration-property-value-disallowed-list": [
|
||||
{
|
||||
"/.*/": [
|
||||
"initial"
|
||||
]
|
||||
},
|
||||
{
|
||||
"message": "The `initial` value is not supported in IE."
|
||||
}
|
||||
],
|
||||
"selector-pseudo-element-colon-notation": "double",
|
||||
"selector-pseudo-element-no-unknown": [true, {
|
||||
"ignorePseudoElements": ["ng-deep"]
|
||||
}],
|
||||
"selector-type-case": "lower",
|
||||
"selector-max-id": 0,
|
||||
"selector-class-pattern": [
|
||||
"^_?(adf|adf-|app|app-|example-|demo-|textLayer|canvasWrapper|page)",
|
||||
{
|
||||
"resolveNestedSelectors": true
|
||||
}
|
||||
],
|
||||
"scss/dollar-variable-empty-line-before": null,
|
||||
"scss/at-rule-conditional-no-parentheses": null
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
specFile=$1;
|
||||
configFile=$2;
|
||||
|
||||
findconfig() {
|
||||
if [ -f "$1" ]; then
|
||||
printf '%s\n' "${PWD%/}/$1"
|
||||
elif [ "$PWD" = / ]; then
|
||||
false
|
||||
else
|
||||
(cd .. && findconfig $1)
|
||||
fi
|
||||
}
|
||||
|
||||
DIR=$(dirname "$specFile")
|
||||
cd $DIR
|
||||
configFile=`findconfig "$configFile"`;
|
||||
echo "$configFile";
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"meterian.meterian-heidi"
|
||||
"lucono.karma-test-explorer"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "e2e",
|
||||
"program": "${workspaceFolder}/node_modules/protractor/bin/protractor",
|
||||
"args": [
|
||||
"`${workspaceFolder}/.vscode/closest-config-finder.sh ${file} e2e/protractor.conf.js`",
|
||||
"--specs=${file}"
|
||||
],
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"console": "integratedTerminal",
|
||||
"sourceMaps": true,
|
||||
"smartStep": true,
|
||||
"skipFiles": [
|
||||
"${workspaceFolder}/node_modules/**/*.js",
|
||||
"<node_internals>/**/*.js"
|
||||
],
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+6
-4
@@ -5,6 +5,7 @@
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/coverage": true,
|
||||
"**/.happypack": true
|
||||
},
|
||||
"markdownlint.config": {
|
||||
@@ -20,14 +21,15 @@
|
||||
"stylelint.enable": true,
|
||||
"css.validate": false,
|
||||
"scss.validate": false,
|
||||
"stylelint.configFile": "${workspaceFolder}/.stylelintrc.json",
|
||||
"stylelint.configBasedir": "${workspaceFolder}",
|
||||
"stylelint.config": {
|
||||
"extends": "./stylelint-config"
|
||||
},
|
||||
"stylelint.configFile": "stylelint-config.json",
|
||||
"stylelint.validate": [
|
||||
"css",
|
||||
"less",
|
||||
"postcss",
|
||||
"scss"
|
||||
],
|
||||
"editor.guides.indentation": true,
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
"editor.guides.indentation": true
|
||||
}
|
||||
|
||||
+3
-1
@@ -103,6 +103,8 @@ Create a file next to the project's `package.json`, call it `proxy.conf.json` an
|
||||
|
||||
Note that if you are running the App, Content Service or Process Service on different ports, you should change the ports accordingly in your local configuration.
|
||||
|
||||
For further details about how to configure a webpack proxy please refer to the [official documentation](https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/proxy.md).
|
||||
|
||||
|
||||
## Configure nginx proxy
|
||||
|
||||
@@ -149,7 +151,7 @@ See the [Alfresco community page](https://community.alfresco.com/community/appli
|
||||
If you want to completely enable CORS calls in your Content Services and Process Services,
|
||||
please refer to the following Alfresco documents:
|
||||
|
||||
* [Enable Cross Origin Resource Sharing (CORS) in Alfresco Process Services](https://support.hyland.com/r/Alfresco/Alfresco-Process-Services/24.4/Alfresco-Process-Services/Configure/Overview/CORS)
|
||||
* [Enable Cross Origin Resource Sharing (CORS) in Alfresco Process Services](http://docs.alfresco.com/process-services1.6/topics/enabling-cors.html)
|
||||
|
||||
* Enable Cross Origin Resource Sharing (CORS) in Alfresco Content Services
|
||||
|
||||
|
||||
+6
-3
@@ -45,11 +45,14 @@ Note: If you need more information about how to sync your fork, see [this page](
|
||||
## Code style
|
||||
|
||||
The code style for ADF follows the [Angular style guide](https://angular.io/guide/styleguide) plus some internal rules.
|
||||
You don’t have to worry too much about those rules because they are automatically checked by tslint/codelyzer/adf-rules.
|
||||
If your code is not compliant with one of these rules you will see an error when you build the project along with some help on how to fix it.
|
||||
|
||||
The codebase is also checked with:
|
||||
The ADF-Rules are as follows:
|
||||
|
||||
- ESLint tool
|
||||
- Stylelint tool
|
||||
* File name component/directive cannot start with Alfresco/Activiti/adf - this rule is to help developers find files easily
|
||||
* Class names cannot start with Alfresco/Activiti/adf for the same reason as above
|
||||
* scss is mandatory. All the classes need to have the `adf-` prefix
|
||||
|
||||
## Test guide
|
||||
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
# 1. Generate licenses
|
||||
|
||||
FROM node:18.16-alpine3.17 AS builder
|
||||
WORKDIR /usr/src/alfresco
|
||||
COPY package.json package.json
|
||||
|
||||
RUN mkdir -p ./licenses && \
|
||||
yarn licenses list > ./licenses/licenses.txt && \
|
||||
yarn licenses generate-disclaimer > ./licenses/disclaimer.txt
|
||||
|
||||
# 2. Generate image
|
||||
|
||||
FROM nginxinc/nginx-unprivileged:1.21-alpine
|
||||
|
||||
USER root
|
||||
RUN apk update && apk upgrade
|
||||
USER 101
|
||||
|
||||
ARG PROJECT_NAME
|
||||
|
||||
COPY docker/default.conf.template /etc/nginx/templates/
|
||||
COPY docker/docker-entrypoint.d/* /docker-entrypoint.d/
|
||||
|
||||
COPY dist/$PROJECT_NAME /usr/share/nginx/html/
|
||||
COPY dist/$PROJECT_NAME/app.config.json /etc/nginx/templates/app.config.json.template
|
||||
COPY --from=builder /usr/src/alfresco/licenses /usr/share/nginx/html/
|
||||
|
||||
USER root
|
||||
RUN chmod a+w -R /etc/nginx/conf.d
|
||||
USER 101
|
||||
|
||||
ENV BASE_PATH=/
|
||||
ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/conf.d
|
||||
@@ -13,7 +13,7 @@ Node: 18.x
|
||||
NPM: 9.x
|
||||
```
|
||||
|
||||
Also, check out the tutorial: [Creating your first ADF Application](docs/tutorials/creating-your-first-adf-application.md)
|
||||
Also, check out the tutorial [Creating your first ADF Application](docs/tutorials/creating-your-first-adf-application.md)
|
||||
for full details on what you may need to install before using ADF.
|
||||
|
||||
### See also
|
||||
@@ -21,29 +21,6 @@ for full details on what you may need to install before using ADF.
|
||||
- [Node Version Manager](docs/tutorials/nvm.md)
|
||||
- [CORS guide](ALFRESCOCORS.md)
|
||||
|
||||
## Installation
|
||||
|
||||
This project uses **pnpm** for package management with built-in supply chain attack protection.
|
||||
|
||||
```bash
|
||||
pnpm install # install all packages
|
||||
pnpm run add <package> # add a new package (with security check)
|
||||
```
|
||||
|
||||
### Supply Chain Security
|
||||
|
||||
**Layer 1: pnpm script blocking**
|
||||
- All lifecycle scripts (postinstall, etc.) are blocked by default
|
||||
- Only trusted packages in `pnpm-workspace.yaml` can run scripts
|
||||
- Protects during `pnpm install` and `pnpm add`
|
||||
|
||||
**Layer 2: Security database check**
|
||||
- `pnpm run add` checks packages against OSV and GitHub Advisory databases BEFORE installing
|
||||
- Pre-commit hook blocks commits containing known malicious packages
|
||||
|
||||
**Layer 3: npm blocked**
|
||||
- Running `npm install` will fail - enforces pnpm usage
|
||||
|
||||
## Components
|
||||
|
||||
You can find the sources for all ADF components in the [`lib`](/lib) folder.
|
||||
@@ -51,7 +28,6 @@ You can find the sources for all ADF components in the [`lib`](/lib) folder.
|
||||
## Libraries
|
||||
|
||||
ADF Libraries list:
|
||||
|
||||
- [Content services](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/content-services)
|
||||
- [Core](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/core)
|
||||
- [Extensions](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/extensions)
|
||||
@@ -60,13 +36,24 @@ ADF Libraries list:
|
||||
- [Process service](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/process-services)
|
||||
- [Stories](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/stories)
|
||||
|
||||
## Demo Application
|
||||
|
||||
A separate application showcasing integration of components can be found
|
||||
[here](https://github.com/Alfresco/alfresco-ng2-components/tree/master/demo-shell).
|
||||
The app has examples of basic interaction for both APS and ACS components.
|
||||
|
||||
## Application generator for Yeoman
|
||||
|
||||
To speed up the development, you can use the
|
||||
[Generator for Yeoman](https://github.com/Alfresco/generator-ng2-alfresco-app).
|
||||
|
||||
## Browser Support
|
||||
|
||||
All components are supported in the following browsers:
|
||||
|
||||
| **Browser** | **Version** |
|
||||
|-------------|-------------|
|
||||
| Chrome | Latest |
|
||||
| Safari | Latest |
|
||||
| Firefox | Latest |
|
||||
| Edge | Latest |
|
||||
|**Browser** |**Version** |
|
||||
|--- |--- |
|
||||
| Chrome | Latest |
|
||||
| Safari | Latest |
|
||||
| Firefox | Latest |
|
||||
| Edge | Latest |
|
||||
|
||||
+1074
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
-13
@@ -1,13 +0,0 @@
|
||||
"project_id": "11"
|
||||
"api_token_env": "CROWDIN_TOKEN"
|
||||
"base_path": "."
|
||||
"base_url": "https://hyland.api.crowdin.com"
|
||||
"preserve_hierarchy": true
|
||||
"files": [
|
||||
{
|
||||
"source": "/**/**/i18n/en.json",
|
||||
"translation": "/%original_path%/%two_letters_code%.%file_extension%",
|
||||
"export_only_approved": "true",
|
||||
"update_option": "update_without_changes"
|
||||
}
|
||||
]
|
||||
+6
-12
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.2",
|
||||
"version": "0.1",
|
||||
"language": "en",
|
||||
"words": [
|
||||
"activiti",
|
||||
@@ -14,11 +14,9 @@
|
||||
"backend",
|
||||
"baseitem",
|
||||
"BASESHAREURL",
|
||||
"berseria",
|
||||
"booleanvisibility",
|
||||
"booleanvisibilityprocess",
|
||||
"boolitem",
|
||||
"BPMECM",
|
||||
"BPMHOST",
|
||||
"cardview",
|
||||
"checkboxes",
|
||||
@@ -49,7 +47,6 @@
|
||||
"dryrun",
|
||||
"ECMBPM",
|
||||
"ECMHOST",
|
||||
"edjs",
|
||||
"Examinate",
|
||||
"exif",
|
||||
"filedata",
|
||||
@@ -80,6 +77,7 @@
|
||||
"lastname",
|
||||
"listgrid",
|
||||
"mapitem",
|
||||
"markdownlint",
|
||||
"mimetype",
|
||||
"mincount",
|
||||
"minlength",
|
||||
@@ -89,10 +87,10 @@
|
||||
"mouseenter",
|
||||
"multiselect",
|
||||
"mysites",
|
||||
"nginx",
|
||||
"numbervisibilityprocess",
|
||||
"OAUTHCONFIG",
|
||||
"oidc",
|
||||
"overridable",
|
||||
"pdfjs",
|
||||
"penta",
|
||||
"printf",
|
||||
@@ -123,7 +121,6 @@
|
||||
"Theming",
|
||||
"transcluded",
|
||||
"transclusion",
|
||||
"triggerable",
|
||||
"truthy",
|
||||
"typeahead",
|
||||
"typeahed",
|
||||
@@ -137,16 +134,14 @@
|
||||
"uploader",
|
||||
"uploadfileform",
|
||||
"userinfo",
|
||||
"validatable",
|
||||
"validators",
|
||||
"waypoint",
|
||||
"waypoints",
|
||||
"webm",
|
||||
"webscript",
|
||||
"Whitespaces",
|
||||
"xdescribe",
|
||||
"xsrf",
|
||||
"zestiria",
|
||||
"webscript"
|
||||
"xsrf"
|
||||
],
|
||||
"dictionaries": [
|
||||
"html",
|
||||
@@ -157,8 +152,7 @@
|
||||
],
|
||||
"ignorePaths": [
|
||||
"lib/{content-services,core,extensions,insights,process-services}/**/*.spec.ts",
|
||||
"lib/{content-services,core,extensions,insights,process-services}/**/*.mock.ts",
|
||||
"**/*.stories.ts"
|
||||
"lib/{content-services,core,extensions,insights,process-services}/**/*.mock.ts"
|
||||
],
|
||||
"ignoreRegExpList": [
|
||||
"(\"|'|`)((?:\\\\1|(?:(?!\\1).))*)\\1"
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* This file decorates the Angular CLI with the Nx CLI to enable features such as computation caching
|
||||
* and faster execution of tasks.
|
||||
*
|
||||
* It does this by:
|
||||
*
|
||||
* - Patching the Angular CLI to warn you in case you accidentally use the undecorated ng command.
|
||||
* - Symlinking the ng to nx command, so all commands run through the Nx CLI
|
||||
* - Updating the package.json postinstall script to give you control over this script
|
||||
*
|
||||
* The Nx CLI decorates the Angular CLI, so the Nx CLI is fully compatible with it.
|
||||
* Every command you run should work the same when using the Nx CLI, except faster.
|
||||
*
|
||||
* Because of symlinking you can still type `ng build/test/lint` in the terminal. The ng command, in this case,
|
||||
* will point to nx, which will perform optimizations before invoking ng. So the Angular CLI is always invoked.
|
||||
* The Nx CLI simply does some optimizations before invoking the Angular CLI.
|
||||
*
|
||||
* To opt out of this patch:
|
||||
* - Replace occurrences of nx with ng in your package.json
|
||||
* - Remove the script from your postinstall script in your package.json
|
||||
* - Delete and reinstall your node_modules
|
||||
*/
|
||||
|
||||
const fs = require("fs");
|
||||
const os = require("os");
|
||||
const cp = require("child_process");
|
||||
const isWindows = os.platform() === "win32";
|
||||
const { output } = require("@nrwl/workspace");
|
||||
|
||||
/**
|
||||
* Paths to files being patched
|
||||
*/
|
||||
const angularCLIInitPath = "node_modules/@angular/cli/lib/cli/index.js";
|
||||
|
||||
/**
|
||||
* Patch index.js to warn you if you invoke the undecorated Angular CLI.
|
||||
*/
|
||||
function patchAngularCLI(initPath) {
|
||||
const angularCLIInit = fs.readFileSync(initPath, "utf-8").toString();
|
||||
|
||||
if (!angularCLIInit.includes("NX_CLI_SET")) {
|
||||
fs.writeFileSync(
|
||||
initPath,
|
||||
`
|
||||
if (!process.env['NX_CLI_SET']) {
|
||||
const { output } = require('@nrwl/workspace');
|
||||
output.warn({ title: 'The Angular CLI was invoked instead of the Nx CLI. Use "npx ng [command]" or "nx [command]" instead.' });
|
||||
}
|
||||
${angularCLIInit}
|
||||
`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
|
||||
* invoke the Nx CLI and get the benefits of computation caching.
|
||||
*/
|
||||
function symlinkNgCLItoNxCLI() {
|
||||
try {
|
||||
const ngPath = "./node_modules/.bin/ng";
|
||||
const nxPath = "./node_modules/.bin/nx";
|
||||
if (isWindows) {
|
||||
/**
|
||||
* This is the most reliable way to create symlink-like behavior on Windows.
|
||||
* Such that it works in all shells and works with npx.
|
||||
*/
|
||||
["", ".cmd", ".ps1"].forEach(ext => {
|
||||
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
|
||||
});
|
||||
} else {
|
||||
// If unix-based, symlink
|
||||
cp.execSync(`ln -sf ./nx ${ngPath}`);
|
||||
}
|
||||
} catch (e) {
|
||||
output.error({
|
||||
title:
|
||||
"Unable to create a symlink from the Angular CLI to the Nx CLI:" +
|
||||
e.message
|
||||
});
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
symlinkNgCLItoNxCLI();
|
||||
patchAngularCLI(angularCLIInitPath);
|
||||
output.log({
|
||||
title: "Angular CLI has been decorated to enable computation caching."
|
||||
});
|
||||
} catch (e) {
|
||||
output.error({
|
||||
title: "Decoration of the Angular CLI did not complete successfully"
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
path = require('path');
|
||||
module.exports = {
|
||||
extends: '../.eslintrc.js',
|
||||
ignorePatterns: ['!**/*'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts'],
|
||||
parserOptions: {
|
||||
project: [
|
||||
path.join(__dirname, 'tsconfig.app.json'),
|
||||
path.join(__dirname, 'src/tsconfig.spec.json'),
|
||||
path.join(__dirname, 'e2e/tsconfig.e2e.json')
|
||||
],
|
||||
createDefaultProgram: true
|
||||
},
|
||||
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-rxjs'],
|
||||
rules: {
|
||||
'@angular-eslint/component-selector': [
|
||||
'error',
|
||||
{
|
||||
type: 'element',
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/directive-selector': [
|
||||
'error',
|
||||
{
|
||||
type: ['element', 'attribute'],
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/no-host-metadata-property': 'off',
|
||||
'@angular-eslint/no-input-prefix': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'off',
|
||||
{
|
||||
accessibility: 'explicit'
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/no-inferrable-types': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'error',
|
||||
'comma-dangle': 'error',
|
||||
'default-case': 'error',
|
||||
'import/order': 'off',
|
||||
'max-len': [
|
||||
'error',
|
||||
{
|
||||
code: 240
|
||||
}
|
||||
],
|
||||
'no-bitwise': 'off',
|
||||
'no-duplicate-imports': 'error',
|
||||
'no-multiple-empty-lines': 'error',
|
||||
'no-redeclare': 'error',
|
||||
'no-return-await': 'error',
|
||||
'rxjs/no-create': 'error',
|
||||
'rxjs/no-subject-unsubscribe': 'error',
|
||||
'rxjs/no-subject-value': 'error',
|
||||
'rxjs/no-unsafe-takeuntil': 'error',
|
||||
'unicorn/filename-case': 'error'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.html'],
|
||||
rules: {}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# misc
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
testem.log
|
||||
/typings
|
||||
|
||||
# e2e
|
||||
/e2e/*.js
|
||||
/e2e/*.map
|
||||
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
typings/
|
||||
node_modules/
|
||||
bower_components/
|
||||
lib/
|
||||
app/**/*.js
|
||||
app/**/*.js.map
|
||||
app/**/*.d.ts
|
||||
|
||||
!app/js/Polyline.js
|
||||
.idea
|
||||
|
||||
|
||||
dist/
|
||||
coverage/
|
||||
!/e2e/protractor.conf.js
|
||||
@@ -0,0 +1,75 @@
|
||||
|
||||
# ADF Demo Application
|
||||
|
||||
Please note that this application is not an official product, but a testing and demo application to showcase complex interactions of ADF components.
|
||||
|
||||
## Installing
|
||||
|
||||
To correctly use this demo check that on your machine you have [Node](https://nodejs.org/en/) version 5.x.x or higher.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Alfresco/alfresco-ng2-components.git
|
||||
cd alfresco-ng2-components
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
## Proxy settings and CORS
|
||||
|
||||
To simplify development and reduce the time to get the application started, we have the following Proxy settings:
|
||||
|
||||
- **http://localhost:3000/ecm** is mapped to **http://localhost:8080**
|
||||
- **http://localhost:3000/bpm** is mapped to **http://localhost:9999**
|
||||
|
||||
The settings above address most common scenarios for running ACS on port 8080 and APS on port 9999 and allow you to skip the CORS configuration.
|
||||
|
||||
If you would like to change default proxy settings, please edit the `proxy.conf.js` file.
|
||||
|
||||
## Application settings (server-side)
|
||||
|
||||
All server-side application settings are stored in the [src/app.config.json](src/app.config.json).
|
||||
By default the configuration files have the content similar to the following one:
|
||||
|
||||
```json
|
||||
{
|
||||
"$schema": "../../lib/core/app-config/schema.json",
|
||||
"ecmHost": "http://{hostname}:{port}",
|
||||
"bpmHost": "http://{hostname}:{port}",
|
||||
"application": {
|
||||
"name": "Alfresco ADF Application"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Development build
|
||||
|
||||
```sh
|
||||
npm start
|
||||
```
|
||||
|
||||
This command compiles and starts the project in watch mode.
|
||||
Browser will automatically reload upon changes.
|
||||
Upon start you can navigate to `http://localhost:3000` with your preferred browser.
|
||||
|
||||
### Important notes
|
||||
|
||||
This script is recommended for development environment and not suited for headless servers and network access.
|
||||
|
||||
## Production build
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
npm run start:prod
|
||||
```
|
||||
|
||||
This command builds project in `production` mode.
|
||||
All output is placed to `dist` folder and can be served to your preferred web server.
|
||||
You should need no additional files outside the `dist` folder.
|
||||
|
||||
## Development branch build
|
||||
|
||||
If you want to run the demo shell with the latest changes from the development branch, use the following command :
|
||||
|
||||
```sh
|
||||
npm run start
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MyAppPage } from './app.po';
|
||||
|
||||
describe('MyApp App', () => {
|
||||
let page: MyAppPage;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new MyAppPage();
|
||||
});
|
||||
|
||||
it('should display toolbar', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getToolbar()).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, element, by } from 'protractor';
|
||||
|
||||
export class MyAppPage {
|
||||
navigateTo() {
|
||||
return browser.get('/');
|
||||
}
|
||||
|
||||
getToolbar() {
|
||||
return element(by.tagName('adf-toolbar'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/e2e",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": ["jasmine", "jasminewd2", "node"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
||||
process.env.CHROME_BIN = require('puppeteer').executablePath();
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: './',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma'),
|
||||
require('karma-mocha-reporter')
|
||||
],
|
||||
client: {
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
files: [],
|
||||
preprocessors: {},
|
||||
mime: {
|
||||
'text/x-typescript': ['ts', 'tsx']
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, 'coverage'), reports: ['html', 'lcovonly'],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
|
||||
customLaunchers: {
|
||||
ChromeHeadless: {
|
||||
base: 'Chrome',
|
||||
flags: [
|
||||
'--no-sandbox',
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--remote-debugging-port=9222'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
captureTimeout: 180000,
|
||||
browserDisconnectTimeout: 180000,
|
||||
browserDisconnectTolerance: 3,
|
||||
browserNoActivityTimeout: 300000,
|
||||
|
||||
reporters: ['mocha', 'kjhtml'],
|
||||
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['ChromeHeadless'],
|
||||
singleRun: false
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Alfresco-ADF-Angular-Demo",
|
||||
"description": "Demo shell for Alfresco Angular components",
|
||||
"version": "6.3.0",
|
||||
"author": "Hyland Software, Inc. and its affiliates",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"keywords": [
|
||||
"ng2",
|
||||
"angular",
|
||||
"angular2",
|
||||
"alfresco"
|
||||
],
|
||||
"private": true
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
module.exports = {
|
||||
getDeployedAppsProxy: function(processHost, deployedApps) {
|
||||
let deployedAppProxy = {};
|
||||
|
||||
if (deployedApps) {
|
||||
try {
|
||||
const deployedAppsArray = JSON.parse(deployedApps);
|
||||
for (const app of deployedAppsArray) {
|
||||
const appName = app.name;
|
||||
const appPath = `/${appName}`;
|
||||
const appPathRewrite = `^/${appName}`;
|
||||
|
||||
deployedAppProxy = {
|
||||
...deployedAppProxy,
|
||||
[appPath]: {
|
||||
target: `${processHost}`,
|
||||
secure: false,
|
||||
pathRewrite: {
|
||||
[appPathRewrite]: appName,
|
||||
},
|
||||
changeOrigin: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
return deployedAppProxy;
|
||||
},
|
||||
getShareProxy: function(host) {
|
||||
console.log('Target for /alfresco', host);
|
||||
return {
|
||||
'/alfresco': {
|
||||
target: host,
|
||||
secure: false,
|
||||
logLevel: 'debug',
|
||||
changeOrigin: true,
|
||||
onProxyReq: function(request) {
|
||||
if(request["method"] !== "GET")
|
||||
request.setHeader("origin", host);
|
||||
},
|
||||
// workaround for REPO-2260
|
||||
onProxyRes: function (proxyRes, req, res) {
|
||||
const header = proxyRes.headers['www-authenticate'];
|
||||
if (header && header.startsWith('Basic')) {
|
||||
proxyRes.headers['www-authenticate'] = 'x' + header;
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
getApsProxy: function(host) {
|
||||
console.log('Target for /activiti-app', host);
|
||||
return {
|
||||
'/activiti-app': {
|
||||
target: host,
|
||||
secure: false,
|
||||
logLevel: 'debug',
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
getIdentityAdapterServiceProxy: function(host) {
|
||||
console.log('Target for /identity-adapter-service', host);
|
||||
return {
|
||||
'/identity-adapter-service': {
|
||||
target: host,
|
||||
secure: false,
|
||||
logLevel: 'debug',
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
require('dotenv').config();
|
||||
|
||||
const { getDeployedAppsProxy, getShareProxy, getApsProxy, getIdentityAdapterServiceProxy } = require('./proxy-helpers');
|
||||
|
||||
const legacyHost = process.env.PROXY_HOST_ADF;
|
||||
const cloudHost = process.env.CLOUD_PROXY_HOST_ADF || process.env.PROXY_HOST_ADF;
|
||||
const cloudApps = process.env.APP_CONFIG_APPS_DEPLOYED;
|
||||
const apsHost = process.env.PROXY_HOST_ADF;
|
||||
|
||||
module.exports = {
|
||||
...getShareProxy(legacyHost),
|
||||
...getApsProxy(apsHost),
|
||||
...getDeployedAppsProxy(cloudHost, cloudApps),
|
||||
...getIdentityAdapterServiceProxy(cloudHost)
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"title": "Welcome",
|
||||
"NOTIFICATIONS": {
|
||||
"TASK_ASSIGNED": "{{taskName}} task has been assigned to {{assignee}}",
|
||||
"PROCESS_STARTED": "{{processName}} process has been started",
|
||||
"TASK_UPDATED": "{{taskName}} task details have been updated",
|
||||
"TASK_CREATED": "{{taskName}} task was created"
|
||||
},
|
||||
"SEARCH": {
|
||||
"RESULTS": "Search results",
|
||||
"NO_RESULT": "No results found",
|
||||
"FACET_FIELDS": {
|
||||
"TYPE": "1:Type",
|
||||
"SIZE": "2:Size",
|
||||
"CREATOR": "3:Creator",
|
||||
"MODIFIER": "4:Modifier",
|
||||
"CREATED": "5:Created"
|
||||
},
|
||||
"FACET_QUERIES": {
|
||||
"MY_FACET_QUERIES": "My facet queries",
|
||||
"CREATED_THIS_YEAR": "1.Created This Year",
|
||||
"MIMETYPE": "2.Type: HTML",
|
||||
"XTRASMALL": "3.Size: xtra small",
|
||||
"SMALL": "4.Size: small",
|
||||
"MEDIUM": "5.Size: medium",
|
||||
"LARGE": "6.Size: large",
|
||||
"XTRALARGE": "7.Size: xtra large",
|
||||
"XXTRALARGE": "8.Size: XX large"
|
||||
}
|
||||
},
|
||||
"GROUP-TITLE1-TRANSLATION-KEY": "CUSTOM TITLE TRANSLATION ONE",
|
||||
"GROUP-TITLE2-TRANSLATION-KEY": "CUSTOM TITLE TRANSLATION TWO",
|
||||
"ERROR_CONTENT": {
|
||||
"507": {
|
||||
"TITLE": "ACS Disk full",
|
||||
"DESCRIPTION": "Content exceeds overall storage quota limit configured for the network or system"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
<div class="app-demo-app-container">
|
||||
<router-outlet></router-outlet>
|
||||
<router-outlet name="overlay"></router-outlet>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
router-outlet[name='overlay'] + * {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.app-demo-app-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
[dir='rtl'] .mat-icon {
|
||||
transform: scale(-1, 1);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import {
|
||||
AuthenticationService,
|
||||
AlfrescoApiService,
|
||||
PageTitleService
|
||||
} from '@alfresco/adf-core';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
|
||||
constructor(private pageTitleService: PageTitleService,
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private authenticationService: AuthenticationService,
|
||||
private router: Router,
|
||||
private dialogRef: MatDialog) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.pageTitleService.setTitle('title');
|
||||
|
||||
this.alfrescoApiService.getInstance().on('error', (error) => {
|
||||
if (error.status === 401) {
|
||||
if (!this.authenticationService.isLoggedIn()) {
|
||||
this.dialogRef.closeAll();
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
}
|
||||
|
||||
if (error.status === 507) {
|
||||
if (!this.authenticationService.isLoggedIn()) {
|
||||
this.dialogRef.closeAll();
|
||||
this.router.navigate(['error/507']);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { NgChartsModule } from 'ng2-charts';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
AppConfigService,
|
||||
DebugAppConfigService,
|
||||
CoreModule,
|
||||
CoreAutomationService,
|
||||
AuthModule,
|
||||
provideTranslations
|
||||
} from '@alfresco/adf-core';
|
||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { AppComponent } from './app.component';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { LogoutComponent } from './components/logout/logout.component';
|
||||
import { AppLayoutComponent } from './components/app-layout/app-layout.component';
|
||||
import { HomeComponent } from './components/home/home.component';
|
||||
import { SearchBarComponent } from './components/search/search-bar.component';
|
||||
import { SearchResultComponent } from './components/search/search-result.component';
|
||||
import { FormComponent } from './components/form/form.component';
|
||||
import { ProcessServiceComponent } from './components/process-service/process-service.component';
|
||||
import { ShowDiagramComponent } from './components/process-service/show-diagram.component';
|
||||
import { FormViewerComponent } from './components/process-service/form-viewer.component';
|
||||
import { FormNodeViewerComponent } from './components/process-service/form-node-viewer.component';
|
||||
import { AppsViewComponent } from './components/process-service/apps-view.component';
|
||||
import { FilesComponent } from './components/files/files.component';
|
||||
import { VersionManagerDialogAdapterComponent } from './components/files/version-manager-dialog-adapter.component';
|
||||
import { MetadataDialogAdapterComponent } from './components/files/metadata-dialog-adapter.component';
|
||||
import { appRoutes } from './app.routes';
|
||||
import { TaskAttachmentsComponent } from './components/process-service/task-attachments.component';
|
||||
import { ProcessAttachmentsComponent } from './components/process-service/process-attachments.component';
|
||||
import { DemoPermissionComponent } from './components/permissions/demo-permissions.component';
|
||||
import { MonacoEditorModule } from 'ngx-monaco-editor-v2';
|
||||
import { ContentModule } from '@alfresco/adf-content-services';
|
||||
import { InsightsModule } from '@alfresco/adf-insights';
|
||||
import { ProcessModule } from '@alfresco/adf-process-services';
|
||||
import { TreeViewSampleComponent } from './components/tree-view/tree-view-sample.component';
|
||||
import { CloudLayoutComponent } from './components/cloud/cloud-layout.component';
|
||||
import { AppsCloudDemoComponent } from './components/cloud/apps-cloud-demo.component';
|
||||
import { TasksCloudDemoComponent } from './components/cloud/tasks-cloud-demo.component';
|
||||
import { ProcessesCloudDemoComponent } from './components/cloud/processes-cloud-demo.component';
|
||||
import { TaskDetailsCloudDemoComponent } from './components/cloud/task-details-cloud-demo.component';
|
||||
import { CloudViewerComponent } from './components/cloud/cloud-viewer.component';
|
||||
import { ProcessDetailsCloudDemoComponent } from './components/cloud/process-details-cloud-demo.component';
|
||||
import { StartTaskCloudDemoComponent } from './components/cloud/start-task-cloud-demo.component';
|
||||
import { StartProcessCloudDemoComponent } from './components/cloud/start-process-cloud-demo.component';
|
||||
import { CloudBreadcrumbsComponent } from './components/cloud/cloud-breadcrumb-component';
|
||||
import { CloudFiltersDemoComponent } from './components/cloud/cloud-filters-demo.component';
|
||||
import { FormCloudDemoComponent } from './components/app-layout/cloud/form-demo/cloud-form-demo.component';
|
||||
import { environment } from '../environments/environment';
|
||||
import { AppCloudSharedModule } from './components/cloud/shared/cloud.shared.module';
|
||||
import { DemoErrorComponent } from './components/error/demo-error.component';
|
||||
import { ProcessServicesCloudModule } from '@alfresco/adf-process-services-cloud';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { ProcessCloudLayoutComponent } from './components/cloud/process-cloud-layout.component';
|
||||
import { CustomEditorComponent, CustomWidgetComponent } from './components/cloud/custom-form-components/custom-editor.component';
|
||||
import { SearchFilterChipsComponent } from './components/search/search-filter-chips.component';
|
||||
import { UserInfoComponent } from './components/app-layout/user-info/user-info.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
|
||||
ReactiveFormsModule,
|
||||
RouterModule.forRoot(appRoutes, { useHash: true, relativeLinkResolution: 'legacy' }),
|
||||
...(environment.oidc ? [AuthModule.forRoot({ useHash: true })] : []),
|
||||
FormsModule,
|
||||
HttpClientModule,
|
||||
MaterialModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ContentModule.forRoot(),
|
||||
InsightsModule.forRoot(),
|
||||
ProcessModule.forRoot(),
|
||||
ProcessServicesCloudModule.forRoot(),
|
||||
ExtensionsModule.forRoot(),
|
||||
NgChartsModule,
|
||||
AppCloudSharedModule,
|
||||
MonacoEditorModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
LogoutComponent,
|
||||
AppLayoutComponent,
|
||||
UserInfoComponent,
|
||||
HomeComponent,
|
||||
SearchBarComponent,
|
||||
SearchResultComponent,
|
||||
ProcessServiceComponent,
|
||||
ShowDiagramComponent,
|
||||
FormViewerComponent,
|
||||
FormNodeViewerComponent,
|
||||
AppsViewComponent,
|
||||
FilesComponent,
|
||||
FormComponent,
|
||||
VersionManagerDialogAdapterComponent,
|
||||
MetadataDialogAdapterComponent,
|
||||
TaskAttachmentsComponent,
|
||||
ProcessAttachmentsComponent,
|
||||
DemoPermissionComponent,
|
||||
DemoErrorComponent,
|
||||
TreeViewSampleComponent,
|
||||
CloudLayoutComponent,
|
||||
AppsCloudDemoComponent,
|
||||
TasksCloudDemoComponent,
|
||||
ProcessesCloudDemoComponent,
|
||||
TaskDetailsCloudDemoComponent,
|
||||
CloudViewerComponent,
|
||||
ProcessDetailsCloudDemoComponent,
|
||||
StartTaskCloudDemoComponent,
|
||||
StartProcessCloudDemoComponent,
|
||||
CloudBreadcrumbsComponent,
|
||||
CloudFiltersDemoComponent,
|
||||
FormCloudDemoComponent,
|
||||
CustomEditorComponent,
|
||||
CustomWidgetComponent,
|
||||
ProcessCloudLayoutComponent,
|
||||
SearchFilterChipsComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AppConfigService, useClass: DebugAppConfigService }, // not use this service in production
|
||||
provideTranslations('app', 'resources')
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule {
|
||||
constructor(automationService: CoreAutomationService) {
|
||||
automationService.setup();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Routes } from '@angular/router';
|
||||
import { AuthGuard, AuthGuardEcm, ErrorContentComponent, AuthGuardBpm, AuthGuardSsoRoleService } from '@alfresco/adf-core';
|
||||
import { AppLayoutComponent } from './components/app-layout/app-layout.component';
|
||||
import { HomeComponent } from './components/home/home.component';
|
||||
import { LogoutComponent } from './components/logout/logout.component';
|
||||
import { ProcessServiceComponent } from './components/process-service/process-service.component';
|
||||
import { ShowDiagramComponent } from './components/process-service/show-diagram.component';
|
||||
import { FormViewerComponent } from './components/process-service/form-viewer.component';
|
||||
import { FormNodeViewerComponent } from './components/process-service/form-node-viewer.component';
|
||||
import { AppsViewComponent } from './components/process-service/apps-view.component';
|
||||
import { SearchResultComponent } from './components/search/search-result.component';
|
||||
import { FilesComponent } from './components/files/files.component';
|
||||
import { FormComponent } from './components/form/form.component';
|
||||
import { DemoPermissionComponent } from './components/permissions/demo-permissions.component';
|
||||
import { AppComponent } from './app.component';
|
||||
import { TreeViewSampleComponent } from './components/tree-view/tree-view-sample.component';
|
||||
import { AppsCloudDemoComponent } from './components/cloud/apps-cloud-demo.component';
|
||||
import { CloudLayoutComponent } from './components/cloud/cloud-layout.component';
|
||||
import { TasksCloudDemoComponent } from './components/cloud/tasks-cloud-demo.component';
|
||||
import { ProcessesCloudDemoComponent } from './components/cloud/processes-cloud-demo.component';
|
||||
import { StartTaskCloudDemoComponent } from './components/cloud/start-task-cloud-demo.component';
|
||||
import { StartProcessCloudDemoComponent } from './components/cloud/start-process-cloud-demo.component';
|
||||
import { TaskDetailsCloudDemoComponent } from './components/cloud/task-details-cloud-demo.component';
|
||||
import { CloudViewerComponent } from './components/cloud/cloud-viewer.component';
|
||||
import { ProcessDetailsCloudDemoComponent } from './components/cloud/process-details-cloud-demo.component';
|
||||
import { FormCloudDemoComponent } from './components/app-layout/cloud/form-demo/cloud-form-demo.component';
|
||||
import { DemoErrorComponent } from './components/error/demo-error.component';
|
||||
import { ProcessCloudLayoutComponent } from './components/cloud/process-cloud-layout.component';
|
||||
import { SearchFilterChipsComponent } from './components/search/search-filter-chips.component';
|
||||
|
||||
export const appRoutes: Routes = [
|
||||
{ path: 'login', loadChildren: () => import('./components/login/login.module').then(m => m.AppLoginModule) },
|
||||
{ path: 'logout', component: LogoutComponent },
|
||||
{
|
||||
path: 'settings',
|
||||
loadChildren: () => import('./components/settings/settings.module').then(m => m.AppSettingsModule)
|
||||
},
|
||||
{
|
||||
path: 'files/:nodeId/view',
|
||||
component: AppComponent,
|
||||
canActivate: [AuthGuardEcm],
|
||||
canActivateChild: [AuthGuardEcm],
|
||||
outlet: 'overlay',
|
||||
loadChildren: () => import('./components/file-view/file-view.module').then(m => m.FileViewModule)
|
||||
},
|
||||
{
|
||||
path: 'files/:nodeId/:versionId/view',
|
||||
component: AppComponent,
|
||||
canActivate: [AuthGuardEcm],
|
||||
canActivateChild: [AuthGuardEcm],
|
||||
outlet: 'overlay',
|
||||
loadChildren: () => import('./components/file-view/file-view.module').then(m => m.FileViewModule)
|
||||
},
|
||||
{
|
||||
path: 'preview/blob',
|
||||
component: AppComponent,
|
||||
outlet: 'overlay',
|
||||
pathMatch: 'full',
|
||||
loadChildren: () => import('./components/file-view/file-view.module').then(m => m.FileViewModule)
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: AppLayoutComponent,
|
||||
canActivate: [AuthGuard],
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: `/home`,
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: 'card-view',
|
||||
loadChildren: () => import('./components/card-view/card-view.module').then(m => m.AppCardViewModule)
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: HomeComponent
|
||||
},
|
||||
{
|
||||
path: 'home',
|
||||
component: HomeComponent
|
||||
},
|
||||
{
|
||||
path: 'cloud',
|
||||
canActivate: [AuthGuardSsoRoleService],
|
||||
data: { roles: ['ACTIVITI_ADMIN', 'ACTIVITI_USER'], redirectUrl: '/error/403' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' },
|
||||
component: AppsCloudDemoComponent
|
||||
},
|
||||
{
|
||||
path: ':appName',
|
||||
canActivate: [AuthGuardSsoRoleService],
|
||||
data: { clientRoles: ['appName'], roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' },
|
||||
component: ProcessCloudLayoutComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: CloudLayoutComponent,
|
||||
children: [
|
||||
{
|
||||
path: 'tasks',
|
||||
component: TasksCloudDemoComponent
|
||||
},
|
||||
{
|
||||
path: 'processes',
|
||||
component: ProcessesCloudDemoComponent
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'start-task',
|
||||
component: StartTaskCloudDemoComponent
|
||||
},
|
||||
{
|
||||
path: 'start-process',
|
||||
component: StartProcessCloudDemoComponent
|
||||
},
|
||||
{
|
||||
path: 'task-details/:taskId',
|
||||
component: TaskDetailsCloudDemoComponent
|
||||
},
|
||||
{
|
||||
path: 'task-details/:taskId/files/:nodeId/view',
|
||||
component: CloudViewerComponent
|
||||
},
|
||||
{
|
||||
path: 'process-details/:processInstanceId',
|
||||
component: ProcessDetailsCloudDemoComponent
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'settings-layout',
|
||||
loadChildren: () => import('./components/settings/settings.module').then(m => m.AppSettingsModule)
|
||||
},
|
||||
{
|
||||
path: 'files',
|
||||
component: FilesComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'files/:id',
|
||||
component: FilesComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'files/:id/display/:mode',
|
||||
component: FilesComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'search',
|
||||
component: SearchResultComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'search-filter-chips',
|
||||
component: SearchFilterChipsComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'activiti',
|
||||
component: AppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps',
|
||||
component: AppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/tasks',
|
||||
component: ProcessServiceComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/tasks/:filterId',
|
||||
component: ProcessServiceComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/processes',
|
||||
component: ProcessServiceComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/processes/:filterId',
|
||||
component: ProcessServiceComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/diagram/:processDefinitionId',
|
||||
component: ShowDiagramComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/report',
|
||||
component: ProcessServiceComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/appId/:appId',
|
||||
component: ProcessServiceComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasks/:id',
|
||||
component: FormViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
/* cspell:disable-next-line */
|
||||
path: 'activiti/tasksnode/:id',
|
||||
component: FormNodeViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'permissions/:id',
|
||||
component: DemoPermissionComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'treeview',
|
||||
component: TreeViewSampleComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{ path: 'form-cloud', component: FormCloudDemoComponent },
|
||||
{ path: 'form', component: FormComponent },
|
||||
{
|
||||
path: 'task-list',
|
||||
canActivate: [AuthGuardBpm],
|
||||
loadChildren: () => import('./components/task-list-demo/task-list.module').then(m => m.AppTaskListModule)
|
||||
},
|
||||
{
|
||||
path: 'process-list',
|
||||
canActivate: [AuthGuardBpm],
|
||||
loadChildren: () => import('./components/process-list-demo/process-list.module').then(m => m.AppProcessListModule)
|
||||
},
|
||||
{
|
||||
path: 'error/no-authorization',
|
||||
component: ErrorContentComponent
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'error',
|
||||
component: AppLayoutComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/error/404',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: DemoErrorComponent
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'error/404'
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,81 @@
|
||||
<adf-sidenav-layout
|
||||
[sidenavMin]="70"
|
||||
[sidenavMax]="220"
|
||||
[stepOver]="780"
|
||||
data-automation-id="sidenav-layout">
|
||||
|
||||
<adf-sidenav-layout-header>
|
||||
<ng-template>
|
||||
<adf-layout-header
|
||||
id="adf-header"
|
||||
title="ADF Demo Application"
|
||||
redirectUrl="/home"
|
||||
tooltip="ADF Demo Application"
|
||||
[showSidenavToggle]="false">
|
||||
|
||||
<div class="app-layout-menu-spacer"></div>
|
||||
|
||||
<app-search-bar></app-search-bar>
|
||||
|
||||
<app-shell-user-info [menuPositionX]="'before'" [menuPositionY]="'above'"></app-shell-user-info>
|
||||
</adf-layout-header>
|
||||
</ng-template>
|
||||
</adf-sidenav-layout-header>
|
||||
|
||||
<adf-sidenav-layout-navigation>
|
||||
<ng-template let-isMenuMinimized="isMenuMinimized">
|
||||
<mat-nav-list class="app-sidenav-linklist">
|
||||
<ng-container *ngFor="let link of links">
|
||||
<ng-container *ngIf="link.children">
|
||||
<mat-list-item (click)="trigger.openMenu()" [attr.data-automation-id]="link.title | translate" class="app-sidenav-link">
|
||||
<mat-icon matListIcon>{{link.icon}}</mat-icon>
|
||||
<span matLine *ngIf="!isMenuMinimized()">{{link.title | translate }}</span>
|
||||
<mat-icon class="app-sidenav-link__expand-button" [matMenuTriggerData]="{links: link.children}"
|
||||
rippleTrigger mat-icon-button #trigger="matMenuTrigger"
|
||||
[matMenuTriggerFor]="nestedMenu">arrow_right</mat-icon>
|
||||
</mat-list-item>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!link.children">
|
||||
<mat-list-item [routerLink]="link.href"
|
||||
routerLinkActive="app-sidenav-link--active" [routerLinkActiveOptions]="{ exact: true }"
|
||||
[attr.data-automation-id]="link.title | translate" class="app-sidenav-link">
|
||||
<mat-icon matListIcon >{{link.icon}}</mat-icon>
|
||||
<span matLine *ngIf="!isMenuMinimized()">{{link.title | translate }}</span>
|
||||
</mat-list-item>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<mat-list-item adf-logout [enableRedirect]="enableRedirect" redirectUri="/logout" class="app-sidenav-link" data-automation-id="Logout" >
|
||||
<mat-icon matListIcon>exit_to_app</mat-icon>
|
||||
<span matLine *ngIf="!isMenuMinimized()">Logout</span>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
||||
</ng-template>
|
||||
</adf-sidenav-layout-navigation>
|
||||
|
||||
<adf-sidenav-layout-content>
|
||||
<ng-template>
|
||||
<router-outlet></router-outlet>
|
||||
</ng-template>
|
||||
</adf-sidenav-layout-content>
|
||||
|
||||
</adf-sidenav-layout>
|
||||
|
||||
<mat-menu #nestedMenu="matMenu" xPosition="after" class="nestedMenu">
|
||||
<ng-template matMenuContent let-links="links">
|
||||
<button mat-menu-item *ngFor="let link of links"
|
||||
class="app-sidenav-link"
|
||||
[attr.data-automation-id]="link.title | translate"
|
||||
routerLinkActive="app-sidenav-link--active"
|
||||
[routerLink]="link.href"
|
||||
[routerLinkActiveOptions]="{ exact: true }">
|
||||
|
||||
<mat-icon matListIcon>{{link.icon}}</mat-icon>
|
||||
{{ link.title | translate }}
|
||||
</button>
|
||||
</ng-template>
|
||||
</mat-menu>
|
||||
|
||||
<adf-file-uploading-dialog #fileDialog position="left"></adf-file-uploading-dialog>
|
||||
@@ -0,0 +1,36 @@
|
||||
adf-file-uploading-dialog {
|
||||
z-index: 1100;
|
||||
}
|
||||
|
||||
.app-layout {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-width: 320px;
|
||||
height: 100%;
|
||||
|
||||
.app-sidenav-link--active {
|
||||
color: var(--theme-primary-color);
|
||||
}
|
||||
|
||||
.app-sidenav-link {
|
||||
.mat-list-text {
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
min-width: 120px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&-menu-spacer {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
}
|
||||
|
||||
mat-sidenav-content > div {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
|
||||
> div {
|
||||
flex: auto;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
templateUrl: './app-layout.component.html',
|
||||
styleUrls: ['./app-layout.component.scss'],
|
||||
host: { class: 'app-layout' },
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AppLayoutComponent {
|
||||
links: Array<any> = [
|
||||
{ href: '/home', icon: 'home', title: 'Home' },
|
||||
{ href: '/files', icon: 'folder_open', title: 'Content Services' },
|
||||
{ href: '/card-view', icon: 'view_headline', title: 'CardView' },
|
||||
{ href: '/task-list', icon: 'assignment', title: 'Task List' },
|
||||
{
|
||||
href: '/cloud', icon: 'cloud', title: 'Process Cloud', children: [
|
||||
{ href: '/cloud/', icon: 'cloud', title: 'Home' },
|
||||
{ href: '/form-cloud', icon: 'poll', title: 'Form' }
|
||||
]
|
||||
},
|
||||
{ href: '/activiti', icon: 'device_hub', title: 'Process Services', children: [
|
||||
{ href: '/activiti', icon: 'vpn_key', title: 'App' },
|
||||
{ href: '/process-list', icon: 'assignment', title: 'Process List' },
|
||||
{ href: '/form', icon: 'poll', title: 'Form' }
|
||||
]},
|
||||
{ href: '/login', icon: 'vpn_key', title: 'Login' },
|
||||
{ href: '/settings-layout', icon: 'settings', title: 'Settings' },
|
||||
{ href: '/treeview', icon: 'nature', title: 'Tree View' }
|
||||
];
|
||||
|
||||
enableRedirect = true;
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
if (this.alfrescoApiService.getInstance().isOauthConfiguration()) {
|
||||
this.enableRedirect = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
<div class="main-content">
|
||||
<mat-tab-group [animationDuration]="0">
|
||||
<mat-tab label="Form" class="form-cloud-render">
|
||||
<div class="app-form-container">
|
||||
<adf-cloud-form
|
||||
[showRefreshButton]="false"
|
||||
[form]="form"
|
||||
(formSaved)="onFormSaved()"
|
||||
(formError)="logErrors($event)">
|
||||
</adf-cloud-form>
|
||||
</div>
|
||||
|
||||
<div class="app-console" #console>
|
||||
<h3>Error log:</h3>
|
||||
<p *ngFor="let error of errorFields">Error {{ error.name }} {{error.validationSummary.message | translate}}</p>
|
||||
</div>
|
||||
</mat-tab>
|
||||
<mat-tab label="Editor" class="form-cloud-editor">
|
||||
<ngx-monaco-editor
|
||||
id="adf-form-config-editor"
|
||||
class="app-form-config-editor"
|
||||
[options]="editorOptions"
|
||||
[(ngModel)]="formConfig"
|
||||
(onInit)="onInitFormEditor($event)">
|
||||
</ngx-monaco-editor>
|
||||
<div class="app-form-editor-buttons">
|
||||
<button mat-raised-button id="app-form-config-save" (click)="onSaveFormConfig()">Save form config</button>
|
||||
<button mat-raised-button id="app-form-config-clear" (click)="onClearFormConfig()">Clear form config</button>
|
||||
<a mat-raised-button class="app-upload-config-button">
|
||||
<mat-icon>file_upload</mat-icon>
|
||||
<label for="upload-config-file">Upload JSON File</label>
|
||||
<input
|
||||
id="upload-config-file"
|
||||
data-automation-id="upload-single-file"
|
||||
type="file"
|
||||
name="uploadConfig"
|
||||
accept=".json"
|
||||
(change)="onConfigAdded($event)">
|
||||
</a>
|
||||
</div>
|
||||
</mat-tab>
|
||||
|
||||
</mat-tab-group>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user