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

Mark job worker-based user task managed by Camunda as deprecated #125

Merged
merged 4 commits into from
Dec 12, 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to [@camunda/linting](https://github.com/camunda/linting) ar

___Note:__ Yet to be released changes appear here._

## 3.30.0

* `FEAT`: rename "Zeebe user task" to "Camunda user task" ([#126](https://github.com/camunda/linting/pull/126))
* `FEAT`: mark job worker-based user task managed by Camunda as deprecated ([#125](https://github.com/camunda/linting/pull/125))
* `DEPS`: update to `[email protected]`

## 3.29.1

* `FIX`: relax `task-listener` to not check implementation type ([camunda/bpmnlint-plugin-camunda-compat#182](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/182))
Expand Down
53 changes: 29 additions & 24 deletions lib/compiled-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const rules = {
"camunda-compat/no-zeebe-properties": "error",
"camunda-compat/no-zeebe-user-task": "error",
"camunda-compat/priority-definition": "error",
"camunda-compat/zeebe-user-task": "warn",
"camunda-compat/secrets": "warn",
"camunda-compat/sequence-flow-condition": "error",
"camunda-compat/signal-reference": "error",
Expand Down Expand Up @@ -231,50 +232,54 @@ import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/priority

cache['bpmnlint-plugin-camunda-compat/priority-definition'] = rule_34;

import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/zeebe-user-task';

cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_35;
cache['bpmnlint-plugin-camunda-compat/zeebe-user-task'] = rule_35;

import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';

cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_36;
cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_36;

import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';

cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_37;
cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_37;

import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';

cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_38;
cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_38;

import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';

cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_39;
cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_39;

import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-listener';
import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';

cache['bpmnlint-plugin-camunda-compat/task-listener'] = rule_40;
cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_40;

import rule_41 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
import rule_41 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-listener';

cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_41;
cache['bpmnlint-plugin-camunda-compat/task-listener'] = rule_41;

import rule_42 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
import rule_42 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';

cache['bpmnlint-plugin-camunda-compat/timer'] = rule_42;
cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_42;

import rule_43 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
import rule_43 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';

cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_43;
cache['bpmnlint-plugin-camunda-compat/timer'] = rule_43;

import rule_44 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
import rule_44 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';

cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_44;
cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_44;

import rule_45 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/version-tag';
import rule_45 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';

cache['bpmnlint-plugin-camunda-compat/version-tag'] = rule_45;
cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_45;

import rule_46 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';
import rule_46 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/version-tag';

cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_46;
cache['bpmnlint-plugin-camunda-compat/version-tag'] = rule_46;

import rule_47 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';

cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_47;
5 changes: 5 additions & 0 deletions lib/utils/documentation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const baseUrl = 'https://docs.camunda.io/docs/next/components/modeler/reference/modeling-guidance/rules';
const userTaskMigrationUrl = 'https://docs.camunda.io/docs/next/apis-tools/migration-manuals/migrate-to-zeebe-user-tasks';

export function getDocumentationUrl(rule) {
if (rule === 'camunda-compat/called-element') {
Expand Down Expand Up @@ -29,6 +30,10 @@ export function getDocumentationUrl(rule) {
return getUrl('history-time-to-live');
}

if (rule === 'camunda-compat/zeebe-user-task') {
return userTaskMigrationUrl;
}

return null;
}

Expand Down
10 changes: 5 additions & 5 deletions lib/utils/error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers
}

if (type === ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED) {
return getExtensionElementRequiredErrorMessage(report);
return getExtensionElementRequiredErrorMessage(report, executionPlatform, executionPlatformVersion);
}

if (type === ERROR_TYPES.PROPERTY_DEPENDENT_REQUIRED) {
Expand Down Expand Up @@ -313,7 +313,7 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex
}

if (is(extensionElement, 'zeebe:UserTask')) {
return getSupportedMessage('A <User Task> with <Implementation: Zeebe user task>', executionPlatform, executionPlatformVersion, allowedVersion);
return getSupportedMessage('A <User Task> with <Implementation: Camunda user task>', executionPlatform, executionPlatformVersion, allowedVersion);
}

if (is(node, 'bpmn:ScriptTask') && is(extensionElement, 'zeebe:Script')) {
Expand Down Expand Up @@ -347,7 +347,7 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex
return message;
}

function getExtensionElementRequiredErrorMessage(report) {
function getExtensionElementRequiredErrorMessage(report, executionPlatform, executionPlatformVersion) {
const {
data,
message
Expand Down Expand Up @@ -390,7 +390,7 @@ function getExtensionElementRequiredErrorMessage(report) {
}

if (requiredExtensionElement === 'zeebe:UserTask') {
return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have <Implementation: Zeebe user task>`;
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Implementation: Job worker> managed by Camunda is deprecated. Consider migrating to <Implementation: Camunda user task>.`;
}

return message;
Expand Down Expand Up @@ -570,7 +570,7 @@ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPla
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Custom form key> must have a defined <Form key>`;
}

// Zeebe User Task
// Camunda User Task
if (is(node, 'zeebe:FormDefinition') && isZeebeUserTask(parentNode)) {
if (isEmptyString(node.get('externalReference'))) {
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: External reference> must have a defined <External reference>`;
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@bpmn-io/diagram-js-ui": "^0.2.3",
"bpmn-moddle": "^9.0.1",
"bpmnlint": "^10.3.1",
"bpmnlint-plugin-camunda-compat": "^2.28.1",
"bpmnlint-plugin-camunda-compat": "^2.29.0",
"bpmnlint-utils": "^1.0.2",
"camunda-bpmn-moddle": "^7.0.1",
"clsx": "^2.0.0",
Expand Down
26 changes: 23 additions & 3 deletions test/spec/utils/error-messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ describe('utils/error-messages', function() {
const errorMessage = getErrorMessage(report, 'Camunda Cloud', executionPlatformVersion);

// then
expect(errorMessage).to.equal('A <User Task> with <Implementation: Zeebe user task> is only supported by Camunda 8.5 or newer');
expect(errorMessage).to.equal('A <User Task> with <Implementation: Camunda user task> is only supported by Camunda 8.5 or newer');
});


Expand Down Expand Up @@ -678,6 +678,26 @@ describe('utils/error-messages', function() {
// then
expect(errorMessage).to.equal('A <User Task> should have a defined <Form>');
});


it('should adjust (zeebe:UserTask)', async function() {

// given
const executionPlatformVersion = '8.6';

const node = createElement('bpmn:UserTask');

const { default: rule } = await import('bpmnlint-plugin-camunda-compat/rules/camunda-cloud/zeebe-user-task');

const report = await getLintError(node, rule);

// when
const errorMessage = getErrorMessage(report, 'Camunda Cloud', executionPlatformVersion);

// then
expect(errorMessage).to.equal('A <User Task> with <Implementation: Job worker> managed by Camunda is deprecated. Consider migrating to <Implementation: Camunda user task>.');
});

});


Expand Down Expand Up @@ -1369,7 +1389,7 @@ describe('utils/error-messages', function() {
});


it('should adjust (Zeebe User Task) (form ID) (Camunda 8.5 and newer)', async function() {
it('should adjust (Camunda User Task) (form ID) (Camunda 8.5 and newer)', async function() {

// given
const node = createElement('bpmn:UserTask', {
Expand Down Expand Up @@ -1433,7 +1453,7 @@ describe('utils/error-messages', function() {
});


it('should adjust (Zeebe User Task) (external reference) (Camunda 8.5 and newer)', async function() {
it('should adjust (Camunda User Task) (external reference) (Camunda 8.5 and newer)', async function() {

// given
const node = createElement('bpmn:UserTask', {
Expand Down
4 changes: 2 additions & 2 deletions test/spec/utils/properties-panel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ describe('utils/properties-panel', function() {
});


it('user-task-form (Zeebe User Task) - Form ID (Camunda 8.5 and newer)', async function() {
it('user-task-form (Camunda User Task) - Form ID (Camunda 8.5 and newer)', async function() {

// given
const node = createElement('bpmn:UserTask', {
Expand Down Expand Up @@ -928,7 +928,7 @@ describe('utils/properties-panel', function() {
});


it('user-task-form (Zeebe User Task) - External reference (Camunda 8.5 and newer)', async function() {
it('user-task-form (Camunda User Task) - External reference (Camunda 8.5 and newer)', async function() {

// given
const node = createElement('bpmn:UserTask', {
Expand Down
Loading