Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
58e52f0
SED-4429 initial draft of mapping fragments to plans
cmisev Feb 6, 2026
d14ca08
Merge branch 'master' into SED-4429-step-ap-ide
cmisev Feb 12, 2026
fbad6b5
SED-4429 fix: remove unused dependencies, gemini code review inputs
cmisev Feb 12, 2026
0a7306a
SED-4429 fix: dependencies
cmisev Feb 12, 2026
12349f4
Merge branch 'master' into SED-4429-step-ap-ide
cmisev Feb 12, 2026
7911b28
SED-4539 basic plan add, remove, modify
cmisev Mar 13, 2026
99c2105
SED-4539 refactor additional field handling
cmisev Mar 13, 2026
364d3b4
SED-4539 simplify Fragment structure
cmisev Mar 13, 2026
9ee49db
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Mar 13, 2026
b9ace31
SED-4539 cleaner string manipulations
cmisev Mar 17, 2026
6b3ad60
SED-4539 generic PatchableYamlArtefactDeserializer
cmisev Mar 19, 2026
289beaa
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Mar 19, 2026
177b99d
SED-4539 fix trivial review issues
cmisev Mar 19, 2026
9caa1f5
SED-4539 fix trivial review issues
cmisev Mar 19, 2026
12b840a
SED-4539 remove unnecessary serializationregistryaware
cmisev Mar 19, 2026
3b47d4c
SED-4539 Exception handling
cmisev Mar 20, 2026
a0507b4
SED-4539 Exception handling
cmisev Mar 20, 2026
5a19c9b
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Mar 20, 2026
3169fc0
SED-4539 Define Collections as Patchable
cmisev Mar 20, 2026
9db55ab
SED-4539 Define Collections as Patchable
cmisev Mar 20, 2026
c07d009
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Mar 24, 2026
7ced285
SED-4631 Update to Jetty 12
cl-exense Mar 31, 2026
d89021f
Merge branch 'master' into SED-4631-update-to-jetty-12
cl-exense Apr 2, 2026
483ea4a
SED-4631 Update plexus-utils
cl-exense Apr 2, 2026
26ca44e
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Apr 2, 2026
d2a178e
Merge branch 'master' into SED-4631-update-to-jetty-12
cl-exense Apr 7, 2026
4fcde11
SED-4631 Remove unused dependency
cl-exense Apr 7, 2026
360247b
Merge branch 'master' into SED-4557-distribution-and-frontend-concept…
cl-exense Apr 8, 2026
fead30f
SED-4631 Removing leftover workarounds
cl-exense Apr 8, 2026
54b63d5
SED-4557 Create module
cl-exense Apr 8, 2026
3e70101
Merge remote-tracking branch 'origin/SED-4631-update-to-jetty-12' int…
cl-exense Apr 8, 2026
e3200c3
SED-4539 WIP Refactor
cmisev Apr 10, 2026
1d0de2c
SED-4539 refactor: introduce PatchingContext
cmisev Apr 13, 2026
fbaf665
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Apr 13, 2026
d007114
SED-4539 fix: unit tests
cmisev Apr 13, 2026
1a591b3
SED-4539 feat: extend patchable to additionalFields
cmisev Apr 13, 2026
dc93ae4
SED-4539 remove superfluous location aware tree parser
cmisev Apr 13, 2026
62b6f6e
SED-4539 fix review comments
cmisev Apr 16, 2026
6fda7fe
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Apr 16, 2026
7fcd655
SED-4539 modify parameters
cmisev Apr 20, 2026
2893c14
Merge branch 'master' into SED-4539-automation-package-collection-and…
cmisev Apr 20, 2026
ff3ed7f
Merge branch 'master' into SED-4557-distribution-and-frontend-concept…
cl-exense Apr 23, 2026
2110d89
Merge branch 'SED-4539-automation-package-collection-and-accessor' in…
cl-exense Apr 23, 2026
a98fd6f
Merge remote-tracking branch 'origin/master' into SED-4557-distributi…
cl-exense Apr 23, 2026
e6e9c0a
SED-4539 plan format fixes, re-read ap in test, function reading
cmisev May 4, 2026
210507a
Merge remote-tracking branch 'origin/SED-4539-automation-package-coll…
cmisev May 4, 2026
7949029
SED-4539 consistency check for added parameters
cmisev May 4, 2026
5449983
SED-4539 improved error message
cmisev May 4, 2026
0562593
SED-4539 keyword loading and WIP on composite keyword loading
cmisev May 4, 2026
4569c0a
SED-4429 SED-4539 Quick-n-dirty bugfixes, logging in APYamlFragmentMa…
cl-exense May 5, 2026
0d90a60
SED-4429 Very WIP - initial step-ap-ide module
cl-exense May 5, 2026
30d01cf
Merge branch 'SED-4539-automation-package-collection-and-accessor' in…
cl-exense May 5, 2026
76aefd7
SED-4539 Fix getCollection idempotence
cl-exense May 5, 2026
eef60b7
Merge remote-tracking branch 'origin/SED-4539-automation-package-coll…
cl-exense May 5, 2026
5a82afb
SED-4429 WIP
cl-exense May 5, 2026
2dbd927
Merge remote-tracking branch 'origin/master' into SED-4429-step-ap-ide
cl-exense May 5, 2026
7b5746c
SED-4429 WIP
cl-exense May 5, 2026
9c0d7ae
SED-4429 Allow switching between APs
cl-exense May 5, 2026
f2f8efc
SED-4539 fix parameter editing
cmisev May 6, 2026
75751c4
Merge remote-tracking branch 'origin/SED-4539-automation-package-coll…
cmisev May 6, 2026
9b25e37
SED-4539 improve parameter editing unit test
cmisev May 6, 2026
a6e8039
Merge remote-tracking branch 'origin/SED-4539-automation-package-coll…
cl-exense May 6, 2026
86110d9
SED-4578 Refactor test classes/resources layout
cl-exense May 6, 2026
cccb72e
SED-4678 Rename module
cl-exense May 6, 2026
6bf39b0
Merge remote-tracking branch 'origin/SED-4678-refactor-test-classes-r…
cl-exense May 6, 2026
6ac6f24
SED-4429 update collections reference name
cl-exense May 6, 2026
f9a39bd
Merge remote-tracking branch 'origin/master' into SED-4429-step-ap-ide
cl-exense May 6, 2026
72affeb
SED-4678 refactor test classes/resources layout, rename module (#640)
cl-exense May 9, 2026
cfeb124
SED-4429 WIP
cl-exense May 11, 2026
dc2884b
Merge remote-tracking branch 'origin/master' into SED-4539-automation…
cl-exense May 11, 2026
6ef962b
Merge branch 'SED-4539-automation-package-collection-and-accessor' in…
cl-exense May 11, 2026
c41364e
SED-4692 Refactor YAML patching logic (#645)
cl-exense May 15, 2026
8745ce2
Merge branch 'master' into SED-4429-step-ap-ide
cl-exense Jun 4, 2026
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
1 change: 1 addition & 0 deletions step-automation-packages/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<module>step-automation-packages-manager</module>
<module>step-automation-packages-client</module>
<module>step-automation-packages-controller</module>
<module>step-automation-packages-ide</module>
</modules>

<properties>
Expand Down
60 changes: 60 additions & 0 deletions step-automation-packages/step-automation-packages-ide/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.exense.step</groupId>
<artifactId>step-automation-packages</artifactId>
<version>0.0.0-SNAPSHOT</version>
</parent>

<artifactId>step-automation-packages-ide</artifactId>

<properties>
<groupId>ch.exense.step</groupId>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>ch.exense.step</groupId>
<artifactId>step-ide</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.exense.step</groupId>
<artifactId>step-automation-packages-controller</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.exense.step</groupId>
<artifactId>step-plans-base-artefacts</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.exense.step</groupId>
<artifactId>step-automation-packages-yaml</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.exense.step</groupId>
<artifactId>step-controller-backend</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
Comment on lines +50 to +55

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The mockito-all dependency is used with a very old version 1.9.5 (from 2012). This artifact is deprecated and can cause dependency conflicts as it bundles other libraries. The project already includes mockito-core (lines 47-50), which is the recommended approach. Please remove the mockito-all dependency to avoid potential issues and keep the dependencies clean.

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*******************************************************************************
* Copyright (C) 2026, exense GmbH
*
* This file is part of STEP
*
* STEP is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* STEP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with STEP. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package step.core.collections;

import java.io.IOException;
import java.util.Properties;

import step.automation.packages.yaml.AutomationPackageYamlFragmentManager;
import step.core.collections.inmemory.InMemoryCollectionFactory;
import step.core.plans.Plan;

public class AutomationPackageCollectionFactory implements CollectionFactory {

private final InMemoryCollectionFactory baseFactory;
private final AutomationPackageYamlFragmentManager fragmentManager;

public AutomationPackageCollectionFactory(Properties properties, AutomationPackageYamlFragmentManager fragmentManager) {
this.fragmentManager = fragmentManager;
this.baseFactory = new InMemoryCollectionFactory(properties);
}

@Override
public <T> Collection<T> getCollection(String name, Class<T> entityClass) {

if (entityClass == Plan.class) {
return (Collection<T>) new AutomationPackagePlanCollection(fragmentManager);
}

return baseFactory.getCollection(name, entityClass);
}

@Override
public Collection<EntityVersion> getVersionedCollection(String name) {
Collection<EntityVersion> baseCollection = baseFactory.getCollection(name, EntityVersion.class);
return baseCollection;
}

@Override
public void close() throws IOException {
baseFactory.close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (C) 2026, exense GmbH
*
* This file is part of STEP
*
* STEP is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* STEP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with STEP. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package step.core.collections;

import step.automation.packages.yaml.AutomationPackageYamlFragmentManager;
import step.core.collections.inmemory.InMemoryCollection;
import step.core.plans.Plan;

public class AutomationPackagePlanCollection extends InMemoryCollection<Plan> implements Collection<Plan> {


private final AutomationPackageYamlFragmentManager fragmentManager;

public AutomationPackagePlanCollection(AutomationPackageYamlFragmentManager fragmentManager) {
super(true, "plan");
this.fragmentManager = fragmentManager;
super.save(fragmentManager.getPlans());
}

@Override
public Plan save(Plan p){
return super.save(fragmentManager.savePlan(p));
}

@Override
public void save(Iterable<Plan> iterable) {
for (Plan p : iterable) {
save(p);
}
}

@Override
public void remove(Filter filter) {
find(filter, null, null, null, 100).forEach(fragmentManager::removePlan);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The remove method uses a hardcoded limit of 100 when finding plans to remove. If more than 100 plans match the filter, only the first 100 will be removed by fragmentManager::removePlan, but super.remove(filter) will remove all matching plans from the in-memory collection. This will lead to an inconsistent state between the file system and the in-memory representation. To fix this, you should fetch all matching plans, for example by passing Integer.MAX_VALUE as the limit.

Suggested change
find(filter, null, null, null, 100).forEach(fragmentManager::removePlan);
find(filter, null, null, null, Integer.MAX_VALUE).forEach(fragmentManager::removePlan);

super.remove(filter);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*******************************************************************************
* Copyright (C) 2026, exense GmbH
*
* This file is part of STEP
*
* STEP is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* STEP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with STEP. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package step.core.collections;

import ch.exense.commons.app.Configuration;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import step.artefacts.Echo;
import step.automation.packages.AutomationPackageHookRegistry;
import step.automation.packages.AutomationPackageReadingException;
import step.automation.packages.JavaAutomationPackageReader;
import step.automation.packages.deserialization.AutomationPackageSerializationRegistry;
import step.automation.packages.scheduler.AutomationPackageSchedulerHook;
import step.automation.packages.yaml.AutomationPackageYamlFragmentManager;
import step.automation.packages.yaml.YamlAutomationPackageVersions;
import step.core.dynamicbeans.DynamicValue;
import step.core.plans.Plan;
import step.core.scheduler.ExecutionScheduler;
import step.core.scheduler.automation.AutomationPackageSchedule;
import step.core.scheduler.automation.AutomationPackageScheduleRegistration;
import step.parameter.ParameterManager;
import step.parameter.automation.AutomationPackageParametersRegistration;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;

import static org.junit.Assert.*;

public class AutomationPackageCollectionTest {



private static final Logger log = LoggerFactory.getLogger(AutomationPackageCollectionTest.class);

private final JavaAutomationPackageReader reader;

private final File sourceDirectory = new File("src/test/resources/samples/step-automation-packages-sample1");;
private File destinationDirectory;
private Collection<Plan> planCollection;
private final Path expectedFilesPath = sourceDirectory.toPath().resolve("expected");

public AutomationPackageCollectionTest() throws AutomationPackageReadingException {
AutomationPackageSerializationRegistry serializationRegistry = new AutomationPackageSerializationRegistry();
AutomationPackageHookRegistry hookRegistry = new AutomationPackageHookRegistry();

AutomationPackageScheduleRegistration.registerSerialization(serializationRegistry);

hookRegistry.register(AutomationPackageSchedule.FIELD_NAME_IN_AP, new AutomationPackageSchedulerHook(Mockito.mock(ExecutionScheduler.class)));

// accessor is not required in this test - we only read the yaml and don't store the result anywhere
AutomationPackageParametersRegistration.registerParametersHooks(hookRegistry, serializationRegistry, Mockito.mock(ParameterManager.class));

this.reader = new JavaAutomationPackageReader(YamlAutomationPackageVersions.ACTUAL_JSON_SCHEMA_PATH, hookRegistry, serializationRegistry, new Configuration());
}

@Before
public void setUp() throws IOException, AutomationPackageReadingException {
Properties properties = new Properties();
destinationDirectory = Files.createTempDirectory("automationPackageCollectionTest").toFile();
FileUtils.copyDirectory(sourceDirectory, destinationDirectory);

AutomationPackageYamlFragmentManager fragmentManager = reader.provideAutomationPackageYamlFragmentManager(destinationDirectory);
AutomationPackageCollectionFactory collectionFactory = new AutomationPackageCollectionFactory(properties, fragmentManager);
planCollection = collectionFactory.getCollection("plan", Plan.class);
}

@After
public void tearDown() throws IOException {
FileUtils.deleteDirectory(destinationDirectory);
}

@Test
public void testReadAllPlans() {
long count = planCollection.count(Filters.empty(), 100);
List<Plan> plans = planCollection.find(Filters.empty(), null, null, null, 100).collect(Collectors.toList());

assertEquals(2, count);
Set<String> names = plans.stream().map(p -> p.getAttributes().get("name")).collect(Collectors.toUnmodifiableSet());

assertEquals(2, names.size());

assertTrue(names.contains("Test Plan"));
assertTrue(names.contains("Test Plan with Composite"));
}

@Test
public void testPlanModify() throws IOException {
Optional<Plan> optionalPlan = planCollection.find(Filters.equals("attributes.name", "Test Plan"), null, null, null, 100).findFirst();

assertTrue(optionalPlan.isPresent());

Plan plan = optionalPlan.get();

Echo firstEcho = (Echo) plan.getRoot().getChildren().get(0);
DynamicValue<Object> text = firstEcho.getText();
text.setDynamic(true);
text.setExpression("new Date().toString();");

planCollection.save(plan);

assertFilesEqual(expectedFilesPath.resolve("plan1AfterModification.yml"), destinationDirectory.toPath().resolve("plans").resolve("plan1.yml"));
}


@Test
public void testPlanRenameExisting() throws IOException {
Optional<Plan> optionalPlan = planCollection.find(Filters.equals("attributes.name", "Test Plan"), null, null, null, 100).findFirst();

assertTrue(optionalPlan.isPresent());

Plan plan = optionalPlan.get();

plan.getAttributes().put("name", "New Plan Name");

planCollection.save(plan);

assertFilesEqual(expectedFilesPath.resolve("plan1AfterRename.yml"), destinationDirectory.toPath().resolve("plans").resolve("plan1.yml"));
}


@Test
public void testPlanRemoveExisting() throws IOException {
planCollection.remove(Filters.equals("attributes.name", "Test Plan"));

assertFilesEqual(expectedFilesPath.resolve("plan1AfterRemove.yml"), destinationDirectory.toPath().resolve("plans").resolve("plan1.yml"));
}

private void assertFilesEqual(Path expected, Path actual) throws IOException {
List<String> expectedLines = Files.readAllLines(expected);
List<String> actualLines = Files.readAllLines(actual);

assertEquals(expectedLines, actualLines);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/ignored
/ignoredFile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
schemaVersion: 1.0.0
name: "My package"
fragments:
- "keywords.yml"
- "plans/*.yml"
- "schedules.yml"
- "parameters.yml"
- "parameters2.yml"
- "unknown.yml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
fragments: []
keywords: []
plans:
- version: "1.2.0"
name: "Test Plan"
root:
testCase:
nodeName: "Test Plan"
children:
- echo:
text:
expression: "new Date().toString();"
- echo:
text:
expression: "mySimpleKey"
- callKeyword:
nodeName: "CallMyKeyword2"
inputs:
- myInput: "myValue"
keyword: "MyKeyword2"
agents: null
categories:
- "Yaml Plan"
plansPlainText:
- name: "Plain text plan"
rootType: "Sequence"
categories:
- "PlainTextPlan"
file: "plans/plan2.plan"
Loading