Skip to content

Commit 772510f

Browse files
pcdavidAxelRICHARD
authored andcommitted
[releng] Improve error reporting in check-labels.js
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
1 parent 83f53bc commit 772510f

6 files changed

Lines changed: 29 additions & 20 deletions

File tree

CHANGELOG.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ As a result, the following GraphQL mutations have been removed `exposeRequiremen
3636
=== Improvements
3737

3838
- https://github.com/eclipse-syson/syson/issues/1583[#1583] [diagrams] Improve support for `Stakeholder`.
39+
On `Requirement` or `Concern` (either definition or usage) graphical nodes it is now possible to create new _stakeholders_ (which must reference existing `PartUsage`).
40+
Stakeholders are by default represented with a dedicated graphical node connected to the parent graphical node, or can appear inside the `stakeholders` list compartment.
3941

4042
=== New features
4143

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewToolService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ public Element reconnectSourceNestedStakeholderEdge(Element self, Element newSou
256256
if (otherEnd.getOwningMembership() instanceof StakeholderMembership stakeholderMembership) {
257257
newSource.getOwnedRelationship().add(stakeholderMembership);
258258
} else {
259-
// This is an error, an Stakeholder should always be contained in an StakeholderMembership.
260-
String errorMessage = "Cannot reconnect the Stakeholder, it is not owned by an " + StakeholderMembership.class.getSimpleName();
259+
// This is an error, a Stakeholder should always be contained in a StakeholderMembership.
260+
String errorMessage = "Cannot reconnect the Stakeholder, it is not owned by a " + StakeholderMembership.class.getSimpleName();
261261
this.logger.error(errorMessage);
262262
this.feedbackMessageService.addFeedbackMessage(new Message(errorMessage, MessageLevel.ERROR));
263263
}
264264
} else {
265-
String errorMessage = "Cannot reconnect an Stakeholder to non-Requirement element";
265+
String errorMessage = "Cannot reconnect a Stakeholder to a non-Requirement element";
266266
this.logger.warn(errorMessage);
267267
this.feedbackMessageService.addFeedbackMessage(new Message(errorMessage, MessageLevel.WARNING));
268268
}
193 KB
Loading
153 KB
Loading

doc/content/modules/user-manual/pages/release-notes/2026.5.0.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
** Add tools to create timeslices and snapshots, available on `OccurrenceUsage`, `ItemUsage`, and `PartUsage` graphical nodes.
2626
These tools leverage a selection dialog to either create a specific timeslice/snapshot graphical node or, if no selection is made, default to a timeslice/snapshot `OccurrenceUsage` graphical node.
2727
** Improved support for `Stakeholder`.
28+
On `Requirement` or `Concern` (either definition or usage) graphical nodes it is now possible to create new _stakeholders_ (which must reference existing `PartUsage`).
29+
Stakeholders are by default represented with a dedicated graphical node connected to the parent graphical node, or can appear inside the `stakeholders` list compartment.
30+
31+
image::release-notes-stakeholder-menu.png[Tool to create a new Stakeholder]
32+
33+
image::release-notes-stakeholder-node.png[Default representation of Stakeholder connected to its corresponding `RequirementDefinition`]
2834

2935
== Technical details
3036

scripts/check-labels.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2023 Obeo.
2+
* Copyright (c) 2023, 2026 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -12,23 +12,24 @@
1212
*******************************************************************************/
1313
const event = process.env.GITHUB_EVENT;
1414
const body = JSON.parse(event);
15+
const labels = body.pull_request.labels;
1516

16-
const hasOnePriorityLabel =
17-
body.pull_request.labels.filter((label) => label.name.startsWith('priority:'))
18-
.length === 1;
19-
const hasOneReviewLabel =
20-
body.pull_request.labels.filter((label) =>
21-
label.name.startsWith('pr: to review')
22-
).length === 1;
23-
24-
if (!hasOnePriorityLabel || !hasOneReviewLabel) {
25-
console.log(
26-
'The pull request is either lacking the priority or the pr label'
27-
);
28-
process.exit(1);
29-
} else if (body.pull_request.labels.length > 2) {
30-
console.log(
31-
'The pull request contains useless labels, please use priority and pr labels for pull requests'
17+
const errors = [];
18+
if (labels.filter((label) => label.name.startsWith("priority:")).length !== 1) {
19+
errors.push("The pull request must have exactly one 'priority:' label");
20+
}
21+
if (
22+
labels.filter((label) => label.name.startsWith("pr: to review")).length !== 1
23+
) {
24+
errors.push("The pull request must have exactly one 'pr: to review' label");
25+
}
26+
if (labels.length > 2) {
27+
errors.push(
28+
"The pull request contains useless labels, please use only priority and pr labels for pull requests",
3229
);
30+
}
31+
32+
if (errors.length > 0) {
33+
errors.map((message) => console.log(message));
3334
process.exit(1);
3435
}

0 commit comments

Comments
 (0)