Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(775): move to GitHub issues #776

Merged
merged 8 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/a11y_investigation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: A11y Investigation
about: Details an accessibility investigation that needs to be done
title: '(A11y) - '
about: Details an accessibility investigation that needs to be done
labels: ["a11y", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug report
about: Create a report to help us improve
title: '(Bug) - '
labels: ["bug", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest a feature/enhancement for NewsKit - External teams should use this instead of story,task,spike etc.
title: ''
labels: ["request", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/spike.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Technical Spike
about: Details a piece of technical research or an investigation that needs to be conducted
title: '(Spike) - '
labels: ["spike", "triage"]
assignees: ''

Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/story.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: User Story
about: Details a specific user facing feature
title: '(Story) - '
about: Details a specific user facing feature
labels: ["story", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Task
about: Details a task
title: '(Task) - '
labels: ["task", "triage"]
assignees: ''

Expand Down
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PPDSC-XXXX
<!-- Replace #000 with github issue number e.g #1234 -->
#000

**What**

Expand Down
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ changelog:
- fix
- title: Documentation 📝
labels:
- doc
- docs
- title: Other Changes 🧱
labels:
- "*"
2 changes: 1 addition & 1 deletion githooks/commitmsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const read = require('@commitlint/read');

const customMessages = {
'scope-enum': {
level2: 'The scope should be a Jira ticket number',
level2: 'The scope should be a GitHub issue number',
},
};

Expand Down
4 changes: 2 additions & 2 deletions githooks/constants.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const chalk = require('chalk');

const TYPES = ['docs', 'feat', 'fix', 'refactor', 'revert', 'upkeep', 'spike'];
const SCOPE_REGEX = /^[A-Z]{2,5}-\d{1,5}$/;
const SCOPE_REGEX = /^[A-Z]{2,5}-\d{1,5}|\d{1,5}$/;
const PLAIN_PREFIX_ERROR_MSG =
"The commit message should be in the format 'type - fix/feat/etc(ticket-number): message'";
"The commit message should be in the format 'type - fix/feat/etc(issue-number): message'";
const FORMATTED_PREFIX_ERROR_MSG = `The commit message should be in the format ${chalk.bold(
"'type",
)}${chalk.reset.dim(' - fix/feat/etc')}${chalk.bold(
Expand Down
8 changes: 4 additions & 4 deletions githooks/preparecommitmsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ const createPrompts = ({type, scope}) => {
SEM_VER_COMMIT_TYPES[SEM_VER_COMMIT_TYPES.length - 1],
},
{
message: 'Enter the Jira ticket number for this commit',
message: 'Enter the github issue number for this commit',
name: 'scope',
transformer: input => input.toUpperCase(),
type: 'input',
validate: input =>
SCOPE_REGEX.test(input.toUpperCase()) || 'e.g. PPDSC-1608',
validate: input => SCOPE_REGEX.test(input.toUpperCase()) || 'e.g. 1608',
when: !scope,
},
];
Expand All @@ -69,7 +68,7 @@ const createPrompts = ({type, scope}) => {

const getBranchData = ({type, scope}) =>
new Promise((resolve, reject) => {
const branchNameRegex = /^(?:(\w*)\/)?([a-z]{2,5}-\d{1,5})?/i;
const branchNameRegex = /^(?:(\w*)\/)?([a-z]{2,5}-\d{1,5}|\d{1,5})?/i;
exec('git rev-parse --abbrev-ref HEAD', (err, stdout, stderr) => {
if (stdout && typeof stdout === 'string') {
const matches = stdout.trim().match(branchNameRegex);
Expand Down Expand Up @@ -102,6 +101,7 @@ if (msgFilePath) {
)
.then(({scope, type, ...parsed}) => {
// remove any already defined type and scope info

const message = parsed.raw
.replace(type, '')
.replace(`(${scope})`, '')
Expand Down