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

check for existing sample at closing issue #24750

Merged
merged 1 commit into from
Jan 4, 2024
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
5 changes: 5 additions & 0 deletions .blueprint/from-issue/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const YO_RC_OUTPUT = 'yo-rc';
const ENTITIES_JDL_OUTPUT = 'entities-jdl';
const RESULT_OUTPUT = 'result';
const VALID_OUTPUT = 'valid';
const CONTAINS_SAMPLE = 'contains-sample';

const BLANK = 'blank';
const VALID = 'valid';
Expand Down Expand Up @@ -70,9 +71,11 @@ export default class extends BaseGenerator {

const regexp = /<summary>(?<title>(?:(?!<\/summary>).)+)<\/summary>\s+<pre>(?<body>(?:(?!<\/pre>).)+)/gs;
let match;
let containsSample = false;
let valid = false;
while ((match = regexp.exec(issue.data.body)) !== null) {
if (match.groups.title.includes('.yo-rc.json file')) {
containsSample = true;
try {
if (match.groups.body) {
const yoRcContent = JSON.parse(match.groups.body);
Expand All @@ -86,10 +89,12 @@ export default class extends BaseGenerator {
setOutput(YO_RC_OUTPUT, ERROR);
}
} else if (match.groups.title.includes('JDL entity definitions')) {
containsSample = true;
this.jdlEntities = match.groups.body?.trim();
setOutput(ENTITIES_JDL_OUTPUT, this.jdlEntities ? VALID : BLANK);
}
}
setOutput(CONTAINS_SAMPLE, containsSample);
setOutput(VALID_OUTPUT, valid);

this.projectFolder = this.projectFolder ?? join(this._globalConfig.get('samplesFolder'), `issues/${this.issue}`);
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/linked-issue-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,45 +81,52 @@ jobs:
id: project
run: jhipster from-issue "${{ matrix.linked-issue }}" --no-code-workspace --disable-blueprints
- name: 'GENERATION: jhipster info'
if: steps.project.outputs.contains-sample != 'false'
run: $JHI_SCRIPTS/14-jhipster-info.sh
#----------------------------------------------------------------------
# Launch tests
#----------------------------------------------------------------------
- name: 'PREPARE: npm install'
if: steps.project.outputs.contains-sample != 'false'
run: npm install
timeout-minutes: 7
- name: 'TESTS: backend'
if: steps.project.outputs.contains-sample != 'false'
id: backend
run: npm run ci:backend:test --if-present
timeout-minutes: 15
- name: 'TESTS: frontend'
if: steps.project.outputs.contains-sample != 'false'
id: frontend
run: npm run ci:frontend:test --if-present
timeout-minutes: 15
- name: 'TESTS: packaging'
if: steps.project.outputs.contains-sample != 'false'
run: npm run ci:e2e:package --if-present
timeout-minutes: 12
- name: 'TESTS: Start docker compose containers for e2e tests'
if: steps.project.outputs.contains-sample != 'false'
run: npm run ci:e2e:prepare --if-present
timeout-minutes: 5
- name: 'E2E: Run'
if: steps.project.outputs.contains-sample != 'false'
id: e2e
run: npm run ci:e2e:run --if-present
timeout-minutes: 15
- name: 'BACKEND: Store failure logs'
uses: actions/upload-artifact@v4
if: always() && steps.backend.outcome == 'failure'
if: always() && steps.backend.outcome == 'failure' && steps.project.outputs.contains-sample != 'false'
with:
name: log-${{ matrix.number }}
path: app/**/test-results/**/*.xml
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v4
if: always() && steps.e2e.outcome == 'failure'
if: always() && steps.e2e.outcome == 'failure' && steps.project.outputs.contains-sample != 'false'
with:
name: screenshots-${{ matrix.number }}
path: app/**/cypress/screenshots
- name: Dump docker logs
if: always()
if: always() && steps.project.outputs.contains-sample != 'false'
uses: jwalton/gh-docker-logs@v2
check-closing-issues:
permissions:
Expand Down