Skip to content

Commit 1d06555

Browse files
authored
Merge pull request #3283 from IgniteUI/vnext
Promote production
2 parents 2c893ea + 27458e2 commit 1d06555

123 files changed

Lines changed: 8989 additions & 7535 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,23 @@ Open both repositories ([DocFX Site Builder](https://github.com/IgniteUI/igniteu
4848
# <a name='#fixing'> Fixing bugs and adding new samples</a>
4949
## <a name='#bug'> Bug fixing guidelines</a>
5050

51-
1. Depending on where the bug was found `the current version` or the `ongoing release version`, checkout a development branches from `vNext` or/and `master` branch. `vNext` is the version that is going to be used upon release (next version), and `master` is the branch with the current state (current version available on production). If the change/fix is applicable only to the ongoing release branch (`vNext`) there is no need to cherry-pick to `master` branch as the change/fix/feature will be pushed to `master` branch upon release.
51+
1. Depending on where the bug was found `the current version` or the `ongoing release version`, checkout a development branches from `vnext` or/and `master` branch. `vnext` is the version that is going to be used upon release (next version), and `master` is the branch with the current state (current version available on production). If the change/fix is applicable only to the ongoing release branch (`vnext`) there is no need to cherry-pick to `master` branch as the change/fix/feature will be pushed to `master` branch upon release.
5252
2. Run lint
5353
3. Pull request your changes and reference the issue. Use the enforced commit message format with applicable type, scope, etc.
5454
4. Don't forget to make the necessary status updates, as described in the workflow section.
5555

56-
> Note: Cherry-pick to `master` branch only changes with **high priority**. There is no need to cherry-pick into `master` every bug fix/change from `vNext`> A regular mass merge PRs are going to be made from `vNext` into `master`.
56+
> Note: Cherry-pick to `master` branch only changes with **high priority**. There is no need to cherry-pick into `master` every bug fix/change from `vnext`> A regular mass merge PRs are going to be made from `vnext` into `master`.
5757
5858
**Example workflow for a bug with high priority**
5959
The process will look like this:
6060

61-
1. Checkout new branch from `vNext`. For code example purposes let's say the new branch is called `fixing-bug-5423-vNext`.
62-
2. Commit your changes to your `fixing-bug-5423-vNext` branch.
63-
3. Push and PR to the `vNext` branch.
61+
1. Checkout new branch from `vnext`. For code example purposes let's say the new branch is called `fixing-bug-5423-vnext`.
62+
2. Commit your changes to your `fixing-bug-5423-vnext` branch.
63+
3. Push and PR to the `vnext` branch.
6464
4. Switch to the `master` branch.
6565
5. Create a new branch from `master`. For code example purposes let's say the new branch is called `fixing-bug-5423-master`.
66-
6. Cherry pick your commit from the `fixing-bug-5423-vNext` branch: `git cherry-pick ..`
66+
6. Cherry pick your commit from the `fixing-bug-5423-vnext` branch: `git cherry-pick ..`
6767
7. Push to your `fixing-bug-5423-master` branch and PR to the `master` branch.
6868

6969
## <a name='#new-sample'> Adding new samples guidelines </a>
70-
Depending on where the the new sample should be added, `the current version` or the `ongoing release version`, checkout a development branches from `vNext` or/and `master` branch. `vNext` is the version that is going to be used upon release (next version), and `master` is the branch with the current state (current version). If the new sample is applicable only to the ongoing release branch (`vNext`) there is no need to cherry-pick to `master` branch as the new sample will be pushed to `master` branch upon release.
70+
Depending on where the the new sample should be added, `the current version` or the `ongoing release version`, checkout a development branches from `vnext` or/and `master` branch. `vnext` is the version that is going to be used upon release (next version), and `master` is the branch with the current state (current version). If the new sample is applicable only to the ongoing release branch (`vnext`) there is no need to cherry-pick to `master` branch as the new sample will be pushed to `master` branch upon release.

.github/workflows/build-app-crm.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ name: App CRM CI
66
# events but only for the master branch
77
on:
88
push:
9-
branches: [ master, vNext ]
9+
branches: [ master, vnext ]
1010
paths:
1111
- '**'
1212
- '!src/**'
1313
- '!live-editing/**'
1414
- '!projects/app-lob/**'
1515
pull_request:
16-
branches: [ master, vNext ]
16+
branches: [ master, vnext ]
1717
paths:
1818
- '**'
1919
- '!src/**'
@@ -34,14 +34,20 @@ jobs:
3434
# Steps represent a sequence of tasks that will be executed as part of the job
3535
steps:
3636
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3838

3939
- name: Use Node.js ${{ matrix.node-version }}
40-
uses: actions/setup-node@v2
40+
uses: actions/setup-node@v3
4141
with:
4242
node-version: ${{ matrix.node-version }}
4343
cache: 'npm'
4444

45+
- name: Npm add registry
46+
run: npm config set @infragistics:registry https://${{secrets.IG_SCOPE}}
47+
48+
- name: Npm config auth
49+
run: npm config set ${{secrets.IG_SCOPE}}:_auth=${{secrets.IG_TOKEN}}
50+
4551
- name: Install dependencies
4652
run: npm ci
4753

.github/workflows/build-app-lob.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: App LOB CI
66
# events but only for the master branch
77
on:
88
push:
9-
branches: [ master, vNext ]
9+
branches: [ master, vnext ]
1010
paths:
1111
- '**'
1212
- '!src/**'
@@ -16,7 +16,7 @@ on:
1616
- 'live-editing/generators/AppDVConfigGenerators.ts'
1717
- '!projects/app-crm/**'
1818
pull_request:
19-
branches: [ master, vNext ]
19+
branches: [ master, vnext ]
2020
paths:
2121
- '**'
2222
- '!src/**'
@@ -39,14 +39,20 @@ jobs:
3939
# Steps represent a sequence of tasks that will be executed as part of the job
4040
steps:
4141
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
42-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v3
4343

4444
- name: Use Node.js ${{ matrix.node-version }}
45-
uses: actions/setup-node@v2
45+
uses: actions/setup-node@v3
4646
with:
4747
node-version: ${{ matrix.node-version }}
4848
cache: 'npm'
4949

50+
- name: Npm add registry
51+
run: npm config set @infragistics:registry https://${{secrets.IG_SCOPE}}
52+
53+
- name: Npm config auth
54+
run: npm config set ${{secrets.IG_SCOPE}}:_auth=${{secrets.IG_TOKEN}}
55+
5056
- name: Install dependencies
5157
run: npm ci
5258

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "master", "vNext" ]
16+
branches: [ "master", "vnext" ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "master", "vNext" ]
19+
branches: [ "master", "vnext" ]
2020
schedule:
2121
- cron: '37 17 * * 1'
2222

.hooks/prepare-commit-msg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
var validate = require('./scripts/validate'),
5+
fs = require('fs');
6+
7+
var options = {
8+
style: "default"
9+
};
10+
11+
var text = fs.readFileSync(process.argv[2]).toString();
12+
13+
var errors = [];
14+
errors = validate(text, options, errors);
15+
16+
if (errors.length > 0) {
17+
process.stdout.write(errors[0].toString());
18+
process.exitCode = 1;
19+
}

.hooks/scripts/common.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'use strict';
2+
3+
module.exports = {
4+
matchType: (types, line) => {
5+
return types.some(function(type) {
6+
if (line.startsWith(type)) {
7+
return true;
8+
}
9+
10+
return false;
11+
});
12+
},
13+
14+
errorFactory: (prefix, message, additionalParams) => {
15+
var result = '';
16+
if (prefix) {
17+
result = prefix;
18+
}
19+
20+
result += message;
21+
22+
if (additionalParams) {
23+
result += additionalParams;
24+
}
25+
26+
return result;
27+
},
28+
29+
errorMessages: {
30+
MESSAGE_SHOULD_START_WITH_TYPE: 'Message should start with one of the following types:\n',
31+
NEED_OPENING_PARENTHESIS: 'Need an opening parenthesis right after the type: (',
32+
TYPE_WAS_EMPTY: '<type> was empty, it must be one of these: \n',
33+
TYPE_WAS_INVALID: '<type> was invalid, It has to be one of these:\n',
34+
NEED_CLOSING_PARENTHESIS: 'Need a closing parenthesis after scope declaration: <scope>")"',
35+
SCOPE_WAS_EMPTY: "<scope> cannot be empty!",
36+
NEED_A_COLON: "Need a colon after the closing parenthesis: ):",
37+
NEED_SPACE_AND_SUBJECT: 'Need a space and <subject> after colon: ": <subject>"',
38+
SUBJECT_WAS_EMPTY: '<subject> must not be empty',
39+
WRONG_REVERT_STRUCT: 'If this is a revert of a previous commit, please write:\n',
40+
UNDEFINED_OF_COMMIT_MSG: 'Commit message is undefined, abort with error',
41+
MSG_IS_NOT_A_STRING: 'Commit message is not a string, abort with error',
42+
MSG_IS_EMPTY: 'Commit message is empty, abort with error'
43+
}
44+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
'use strict';
2+
3+
var matchType = require('../common').matchType,
4+
errorFactory = require('../common').errorFactory,
5+
errMessages = require('../common').errorMessages;
6+
7+
module.exports = (lines, options, errors) => {
8+
var scheme = '<type>(<scope>): <subject> <#issue|optional>';
9+
var prefix = `First line must be ${scheme}\n`;
10+
11+
var line = lines[0];
12+
if (line.startsWith('revert: ')) {
13+
line = line.replace(/^revert: /, '');
14+
prefix = `First line must be revert: ${scheme}\n`;
15+
} else if (line.startsWith('revert')) {
16+
errors.push(errorFactory(errMessages.WRONG_REVERT_STRUCT, 'revert: ' + scheme));
17+
18+
return;
19+
}
20+
21+
if (!matchType(options.types, line)) {
22+
errors.push(errorFactory(prefix, errMessages.MESSAGE_SHOULD_START_WITH_TYPE, options.types.join(', ')));
23+
24+
return;
25+
}
26+
27+
if (line.indexOf('(') === -1) {
28+
errors.push(errorFactory(prefix, errMessages.NEED_OPENING_PARENTHESIS));
29+
30+
return;
31+
}
32+
33+
var type = line.replace(/\(.*/, '');
34+
if (options.types.indexOf(type) === -1) {
35+
errors.push(errorFactory(prefix, errMessages.TYPE_WAS_INVALID, options.types.join(', ')));
36+
37+
return;
38+
}
39+
40+
if (line.indexOf(')') === -1) {
41+
errors.push(errorFactory(prefix, errMessages.NEED_CLOSING_PARENTHESIS));
42+
43+
return;
44+
}
45+
46+
var scope = line.slice(line.indexOf('(') + 1, line.indexOf(')'));
47+
if (scope.length === 0) {
48+
errors.push(errorFactory(prefix, errMessages.SCOPE_WAS_EMPTY));
49+
}
50+
51+
if (line.indexOf(type + '(' + scope + '):') === - 1) {
52+
errors.push(errorFactory(prefix, errMessages.NEED_A_COLON));
53+
54+
return;
55+
}
56+
57+
var subject = line.split(':')[1];
58+
if (subject === "" || !subject.startsWith(' ')) {
59+
errors.push(errorFactory(prefix, errMessages.NEED_SPACE_AND_SUBJECT));
60+
61+
return;
62+
}
63+
64+
subject = subject.trim();
65+
66+
if (subject.length === 0) {
67+
errors.push(errorFactory(errMessages.SUBJECT_WAS_EMPTY));
68+
69+
return;
70+
}
71+
72+
if (subject.length < options.subjectLimits) {
73+
errors.push(`<subject> should contains at least ${options.subjectLimits} characters`);
74+
}
75+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
var path = require('path');
4+
5+
var defaults = {
6+
default: {
7+
style: 'default',
8+
subjectLimits: 15,
9+
lineLimits: {
10+
firstLine: 80,
11+
otherLine: 80,
12+
},
13+
issuePattern: '(#)[0-9]+',
14+
typesWithMandatoryIssue: [],
15+
guidelinesUrl: 'https://bit.ly/angular-guidelines',
16+
types: [
17+
'feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'chore', 'build', 'ci', 'revert'
18+
],
19+
},
20+
oldMessagePath: path.join('.git', 'COMMIT_EDITMSG_OLD')
21+
}
22+
23+
module.exports = defaults;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
'use strict';
2+
3+
var matchType = require('../common').matchType,
4+
errorFactory = require('../common').errorFactory;
5+
6+
module.exports = (lines, options, errors) => {
7+
var ticket = new RegExp(options.issuePattern);
8+
var whetherIssueIsMandatory = false,
9+
wheterMatchAnyIssueRef = false;
10+
11+
12+
if (matchType(options.typesWithMandatoryIssue, lines[0])) {
13+
whetherIssueIsMandatory = true;
14+
}
15+
16+
lines.forEach((line) => {
17+
line = line.trim();
18+
if (line === "") {
19+
return;
20+
}
21+
22+
if (ticket.test(line)) {
23+
wheterMatchAnyIssueRef = true;
24+
return;
25+
}
26+
});
27+
28+
if (whetherIssueIsMandatory && !wheterMatchAnyIssueRef) {
29+
errors.push(errorFactory(
30+
`The issue reference for (${options.typesWithMandatoryIssue.join(', ')}) types is mandatory!\n`,
31+
"Please add at least one related issue. E.g: Closes #31, Closes #45"));
32+
}
33+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
module.exports = (lines, options, errors) => {
4+
var limits = options.lineLimits;
5+
lines.forEach((line, index) => {
6+
line = line.trim();
7+
if (index === 0) {
8+
if (line.length === 0) {
9+
errors.push('First line of commit message must not be empty!');
10+
} else if (line.length > limits.firstLine) {
11+
errors.push(`First line of commit message must be no logner than ${limits.firstLine} characters!`);
12+
}
13+
} else if (index === 1 && line.length > 0) {
14+
errors.push('Second line must be always empty!');
15+
} else if (line.length > limits.otherLine) {
16+
errors.push(
17+
`Commit message line ${index + 1} is too long: ${line.length}, only ${limits.otherLine} are allowed.
18+
The line is: ${line.substring(0, 20)} [...]!`
19+
);
20+
}
21+
});
22+
}

0 commit comments

Comments
 (0)