Skip to content

Commit 3c803ee

Browse files
Merge pull request #109 from boozallen/82
#82 Address caching defects in downstream html report generation
2 parents 1f61c05 + c48d48c commit 3c803ee

File tree

6 files changed

+122
-30
lines changed

6 files changed

+122
-30
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Booz Allen Public License v1.0
2+
------------------------------
3+
4+
INTRODUCTION
5+
The Booz Allen Public License allows government, non-profit academic, other non-profit, and commercial entities access to distinctive, disruptive, and robust code with the goal of Empowering People to Change the World(SM). Products licensed under the Booz Allen Public License are founded on the basis that collective ingenuity can make the largest impact in the community.
6+
7+
DEFINITIONS
8+
* **Commercial Entity.** “Commercial Entity” means any individual or entity other than a government, non-profit academic, or other non-profit entity.
9+
* **Derivative.** “Derivative” means any work of authorship in Source Code or Object Code form that results from an addition to, deletion from, or modification of the Source Code of the Product.
10+
* **License.** “License” means this Booz Allen Public License.
11+
* **Object Code.** “Object Code” means the form resulting from transformation or translation of Source Code into machine readable code, including but not limited to, compiled object code.
12+
* **Originator.** “Originator” means each individual or legal entity that creates, contributes to the creation of, or owns the Product.
13+
* **Patent Claims.** “Patent Claims” means any patent claim(s) in any patent to which Originator has a right to grant a license that would be infringed by Your making, using, selling, offering for sale, having made, or importing of the Product, but for the grant of this License.
14+
* **Product.** “Product” means the Source Code of the software which the initial Originator made available under this License, and any Derivative of such Source Code.
15+
* **Source Code.** “Source Code” means software in human-readable form.
16+
* **You.** “You” means either an individual or an entity (if you are taking this license on behalf of an entity) that exercises the rights granted under this License.
17+
18+
LICENSE
19+
**Government/Non-Profit Academic/Other Non-Profit.**
20+
This Section applies if You are not a Commercial Entity.
21+
22+
* **License.** Subject to the terms and conditions of this License, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license to reproduce, display, perform, modify, distribute and otherwise use the Product and Derivatives, in Source Code and Object Code form, in accordance with the terms and conditions of this License in order to support the general public good and for your internal business purposes.
23+
* **Distribution.** You may distribute to third parties copies of the Product, including any Derivative that You create, in Source Code or Object Code form. If You distribute copies of the Product, including any Derivative that You create, in Source Code form, such distribution must be under the terms of this License and You must inform recipients of the Source Code that the Product is governed under this License and how they can obtain a copy of this License. You may distribute to third parties copies of the Product, including any Derivative that You create, in Object Code form, or allow third parties to access or use the Product, including any Derivative that You create, under a license of Your choice.
24+
* **Commercial Sales.** You may not distribute, or allow third parties to access or use, the Product or any Derivative for a fee, unless You first obtain permission from the Originator. If Booz Allen Hamilton is the Originator, please contact Booz Allen Hamilton at <opensource@bah.com>.
25+
26+
**Commercial Entities**.
27+
This Section applies if You are a Commercial Entity.
28+
29+
* **License.** Subject to the terms and conditions of this License, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license to reproduce, display, perform, modify, distribute and otherwise use the Product and Derivatives, in Source Code and Object Code form, in accordance with the terms and conditions of this License for the sole purpose of Your internal business purposes and the provision of services to government, non-profit academic, and other non-profit entities.
30+
* **Distribution and Derivatives.** You may distribute to third parties copies of the Product, including any Derivative that You create, in Source Code or Object Code form. If You distribute copies of the Product, including any Derivative that You create, in Source Code form, such distribution must be under the terms of this License and You must inform recipients of the Source Code that the Product is governed under this License and how they can obtain a copy of this License. You may distribute to third parties copies of the Product, including any Derivative that You create, in Object Code form, or allow third parties to access or use the Product, including any Derivative that You create, under a license of Your choice, provided that You make available, and inform the recipient of such distribution how they can obtain, a copy of the Source Code thereof, at no charge, and inform the recipient of the Source Code that the Product is governed under this License and how they can obtain a copy of this License.
31+
* **Commercial Sales.** You may not distribute, or allow third parties to access or use, the Product or any Derivative for a fee, unless You first obtain permission from the Originator. If Booz Allen Hamilton, please contact Booz Allen Hamilton at <opensource@bah.com>.
32+
33+
34+
**Patent Claim(s)**.
35+
This Section applies regardless of whether You are a government, non-profit academic, or other non-profit entity or a Commercial Entity.
36+
37+
* **Patent License.** Subject to the limitations in the Sections above, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license under Patent Claims of such Originator to make, use, sell, offer for sale, have made, and import the Product. The foregoing patent license does not apply (a) to any code that an Originator has removed from the Product, or (b) for infringement caused by Your modifications of the Product or the combination of any Derivative created by You or on Your behalf with other software.
38+
39+
GENERAL TERMS
40+
This Section applies regardless of whether You are a government, non-profit academic, or other non-profit entity or a Commercial Entity.
41+
42+
* **Required Notices.** If You distribute the Product or a Derivative, in Object Code or Source Code form, You shall not remove or otherwise modify any proprietary markings or notices contained within or placed upon the Product or any Derivative. Any distribution of the Product or a Derivative, in Object Code or Source Code form, shall contain a clear and conspicuous Originator copyright and license reference in accordance with the below:
43+
* *Unmodified Product Notice*: “This software package is licensed under the Booz Allen Public License. Copyright © 20__ [Copyright Holder Name]. All Rights Reserved.”
44+
* *Derivative Notice*: “This software package is licensed under the Booz Allen Public License. Portions of this code are Copyright © 20__ [Copyright Holder Name]. All Rights Reserved.”
45+
* **Compliance with Laws.** You agree that You shall not reproduce, display, perform, modify, distribute and otherwise use the Product in any way that violates applicable law or regulation or infringes or violates the rights of others, including, but not limited to, third party intellectual property, privacy, and publicity rights.
46+
* **Disclaimer.** You understand that the Product is licensed to You, and not sold. The Product is provided on an “As Is” basis, without any warranties, representations, and guarantees, whether oral or written, express, implied or statutory, with regard to the Product, including without limitation, warranties of merchantability, fitness for a particular purpose, title, non-infringement, non-interference, and warranties arising from course of dealing or usage of trade, to the maximum extent permitted by applicable law. Originator does not warrant that (i) the Product will meet your needs; (ii) the Product will be error-free or accessible at all times; or (iii) the use or the results of the use of the Product will be correct, accurate, timely, or otherwise reliable. You acknowledge that the Product has not been prepared to meet Your individual requirements, whether or not such requirements have been communicated to Originator. You assume all responsibility for use of the Product.
47+
* **Limitation of Liability.** Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Originator, or anyone who distributes the Product in accordance with this License, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if informed of the possibility of such damages.
48+
* **Export Control.** The Product is subject to U.S. export control laws and may be subject to export or import regulations in other countries. You agree to strictly comply with all such laws and regulations and acknowledges that You are responsible for obtaining such licenses to export, re-export, or import as may be required.
49+
* **Severability.** If the application of any provision of this License to any particular facts or circumstances shall be held to be invalid or unenforceable, then the validity and enforceability of other provisions of this License shall not in any way be affected or impaired thereby.

foundation/foundation-archetype/src/main/resources/archetype-resources/.mvn/maven-build-cache-config.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
<dirName>dockerbuild</dirName>
4444
<dirName>krausening</dirName>
4545
<!-- Reports needed on CI to ensure consistent reporting of QA metrics: -->
46-
<dirName>cucumber-reports</dirName>
47-
<dirName>surefire-reports</dirName>
48-
<dirName>failsafe-reports</dirName>
46+
<dirName>../target/cucumber-reports</dirName>
47+
<dirName>../target/surefire-reports</dirName>
48+
<dirName>../target/failsafe-reports</dirName>
4949
</dirNames>
5050
</attachedOutputs>
5151
<local>

foundation/foundation-archetype/src/test/resources/test-project-archetype-script/maven-build-cache-config.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
<dirName>quarkus-app</dirName>
5050
<dirName>helm</dirName>
5151
<!-- Reports needed on CI to ensure consistent reporting of QA metrics: -->
52-
<dirName>cucumber-reports</dirName>
53-
<dirName>surefire-reports</dirName>
54-
<dirName>failsafe-reports</dirName>
52+
<dirName>../target/cucumber-reports</dirName>
53+
<dirName>../target/surefire-reports</dirName>
54+
<dirName>../target/failsafe-reports</dirName>
5555
</dirNames>
5656
</attachedOutputs>
5757
<local>

foundation/foundation-mda/src/main/resources/templates/general-mlflow/pipeline.step.pom.xml.vm

+16-7
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,22 @@
9595
</plugin>
9696

9797
<plugin>
98-
<groupId>org.codehaus.mojo</groupId>
99-
<artifactId>license-maven-plugin</artifactId>
100-
<configuration>
101-
<licenseFile>LICENSE</licenseFile>
102-
</configuration>
103-
</plugin>
98+
<groupId>org.codehaus.mojo</groupId>
99+
<artifactId>license-maven-plugin</artifactId>
100+
<configuration>
101+
<licenseFile>LICENSE</licenseFile>
102+
</configuration>
103+
</plugin>
104+
<plugin>
105+
<groupId>net.masterthought</groupId>
106+
<artifactId>maven-cucumber-reporting</artifactId>
107+
</plugin>
104108
</plugins>
105109
</build>
106-
110+
<dependencies>
111+
<dependency>
112+
<groupId>net.masterthought</groupId>
113+
<artifactId>cucumber-reporting</artifactId>
114+
</dependency>
115+
</dependencies>
107116
</project>

foundation/foundation-mda/src/test/java/com/boozallen/aiops/mda/generator/DataRecordsModuleStep.java

+41-16
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
* This software package is licensed under the Booz Allen Public License. All Rights Reserved.
88
* #L%
99
*/
10+
11+
import com.boozallen.aiops.mda.generator.util.PipelineUtils;
12+
1013
import com.boozallen.aiops.mda.metamodel.element.AbstractModelInstanceSteps;
14+
import com.boozallen.aiops.mda.metamodel.element.BaseStepDecorator;
15+
import com.boozallen.aiops.mda.metamodel.element.RecordElement;
1116
import com.boozallen.aiops.mda.metamodel.element.BasePipelineDecorator;
1217
import com.boozallen.aiops.mda.metamodel.element.Pipeline;
13-
import com.boozallen.aiops.mda.metamodel.element.RecordElement;
1418
import com.boozallen.aiops.mda.metamodel.element.python.PythonRecord;
1519
import io.cucumber.java.Before;
1620
import io.cucumber.java.Scenario;
17-
import io.cucumber.java.en.And;
1821
import io.cucumber.java.en.Given;
1922
import io.cucumber.java.en.Then;
2023
import io.cucumber.java.en.When;
@@ -42,6 +45,7 @@
4245
import java.util.List;
4346
import java.util.Map;
4447
import java.util.regex.Pattern;
48+
4549
import static org.junit.Assert.assertTrue;
4650

4751
public class DataRecordsModuleStep extends AbstractModelInstanceSteps {
@@ -97,13 +101,9 @@ public void a_pre_existing_semantic_data_module_called_with(String moduleName, S
97101
public void the_profile_is_generated(String profileName) throws Exception {
98102
readMetadata(projectName);
99103
Map<String, ExpandedProfile> profiles = loadProfiles();
100-
GenerateSourcesHelper.performSourceGeneration(profileName, profiles,
101-
this::createGenerationContext,
102-
(missingProfile, foundProfiles) -> {
103-
throw new RuntimeException("Missing profile: " + missingProfile);
104-
},
105-
new Slf4jDelegate(logger),
106-
projectDir.toFile());
104+
GenerateSourcesHelper.performSourceGeneration(profileName, profiles, this::createGenerationContext, (missingProfile, foundProfiles) -> {
105+
throw new RuntimeException("Missing profile: " + missingProfile);
106+
}, new Slf4jDelegate(logger), projectDir.toFile());
107107
}
108108

109109
@Then("a semantic-data module is generated with {string} under {string}")
@@ -137,8 +137,7 @@ public void the_user_is_notified_that_the_module_must_be_added_to_the_parent_pom
137137
@Then("no module is generated under {string}")
138138
public void no_module_is_generated_under(String moduleName) {
139139
Path module = projectDir.resolve(moduleName);
140-
assertTrue("Language-specific module created when existing module should have been reused: " + moduleName,
141-
Files.notExists(module));
140+
assertTrue("Language-specific module created when existing module should have been reused: " + moduleName, Files.notExists(module));
142141
}
143142

144143
@Then("the pipeline POM has a dependency on {string}")
@@ -151,6 +150,16 @@ public void the_pipeline_pom_has_the_plugin(String plugin) throws Exception {
151150
the_pipeline_pom_has_the_plugin(pipeline.getName(), plugin);
152151
}
153152

153+
@Then("the pipeline's child POMs have a dependency on {string}")
154+
public void the_pipelines_child_poms_have_a_dependency_on(String dataModule) throws Exception {
155+
the_pipeline_child_poms_have_a_dependency_on(pipeline.getName(), dataModule);
156+
}
157+
158+
@Then("the pipeline's child POMs has the plugin {string}")
159+
public void the_pipelines_child_poms_have_the_plugin(String plugin) throws Exception {
160+
the_pipeline_child_poms_have_the_plugin(pipeline.getName(), plugin);
161+
}
162+
154163
@Then("{string} has a dependency on {string}")
155164
public void has_a_dependency_on(String module, String dependency) throws Exception {
156165
Path pom = projectDir.resolve(module).resolve("pom.xml");
@@ -175,19 +184,36 @@ public void the_pipeline_pom_has_a_dependency_on(String pipelineName, String dat
175184
has_a_dependency_on(decoratedPipeline.deriveArtifactIdFromCamelCase(), dataModule);
176185
}
177186

187+
@Then("the {string} pipeline child POMs have a dependency on {string}")
188+
public void the_pipeline_child_poms_have_a_dependency_on(String pipelineName, String dataModule) throws Exception {
189+
Pipeline pipeline = pipelines.get(pipelineName);
190+
BasePipelineDecorator decoratedPipeline = new BasePipelineDecorator(pipeline);
191+
for (BaseStepDecorator step : decoratedPipeline.getSteps()) {
192+
has_a_dependency_on(PipelineUtils.deriveArtifactIdFromCamelCase(step.getName()), dataModule);
193+
}
194+
}
195+
178196
@Then("the {string} pipeline POM has the plugin {string}")
179197
public void the_pipeline_pom_has_the_plugin(String pipelineName, String dataModule) throws Exception {
180198
Pipeline pipeline = pipelines.get(pipelineName);
181199
BasePipelineDecorator decoratedPipeline = new BasePipelineDecorator(pipeline);
182200
has_the_plugin(decoratedPipeline.deriveArtifactIdFromCamelCase(), dataModule);
183201
}
184202

203+
@Then("the {string} pipeline child POMs have the plugin {string}")
204+
public void the_pipeline_child_poms_have_the_plugin(String pipelineName, String dataModule) throws Exception {
205+
Pipeline pipeline = pipelines.get(pipelineName);
206+
BasePipelineDecorator decoratedPipeline = new BasePipelineDecorator(pipeline);
207+
for (BaseStepDecorator step : decoratedPipeline.getSteps()) {
208+
has_the_plugin(PipelineUtils.deriveArtifactIdFromCamelCase(step.getName()), dataModule);
209+
}
210+
}
211+
185212
@Then("the pyproject.toml file has a dependency on {string}")
186213
public void the_pyproject_toml_file_has_a_dependency_on(String dataModule) throws IOException {
187214
Path pyproject = projectDir.resolve("pyproject.toml");
188215
Pattern monoRepoPattern = Pattern.compile(dataModule + " *= *\\{path *= \".*?" + dataModule + "\".*?}");
189-
boolean hasDependency = Files.lines(pyproject)
190-
.anyMatch(monoRepoPattern.asMatchPredicate());
216+
boolean hasDependency = Files.lines(pyproject).anyMatch(monoRepoPattern.asMatchPredicate());
191217
assertTrue("Dependency " + dataModule + " not found in " + pyproject, hasDependency);
192218
}
193219

@@ -251,8 +277,7 @@ private Notification getNotification(String file, String notificationType) {
251277
Map<String, Map<String, Notification>> notifications = NotificationCollector.getNotifications();
252278
assertTrue("No notifications for file " + file, notifications.containsKey(file));
253279
Map<String, Notification> fileNotifications = notifications.get(file);
254-
assertTrue("No notifications of type " + notificationType + " for " + file,
255-
fileNotifications.containsKey(file + "_" + notificationType));
280+
assertTrue("No notifications of type " + notificationType + " for " + file, fileNotifications.containsKey(file + "_" + notificationType));
256281
return fileNotifications.get(file + "_" + notificationType);
257282
}
258283

@@ -261,7 +286,7 @@ private Notification getNotification(String file, String notificationType) {
261286
* expected content.
262287
*
263288
* @param pom the POM file
264-
* @param query the XPath query
289+
* @param query the XPath query
265290
* @param content the expected content
266291
* @return true if the content is found
267292
* @throws Exception if the POM cannot be read

foundation/foundation-mda/src/test/resources/specifications/data-records-generation.feature

+10-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Feature: Generating pipeline resources
181181
| data-flow | data-delivery-pyspark |
182182

183183
@pipeline-generation @module-generation
184-
Scenario Outline: Habushu pipelines integrate test report generation by default
184+
Scenario Outline: Spark and Pyspark pipelines integrate test report generation by default
185185
Given a project named "example"
186186
And a "<type>" pipeline using "<implementation>"
187187
And a dictionary and 0 or more record models
@@ -194,6 +194,15 @@ Feature: Generating pipeline resources
194194
| data-flow | data-delivery-pyspark | aissemble-maven-modules |
195195
| data-flow | data-delivery-spark | aissemble-maven-modules |
196196

197+
@pipeline-generation @module-generation
198+
Scenario: Machine learning pipelines integrate test report generation in child modules by default
199+
Given a project named "example"
200+
And a "machine-learning" pipeline using "machine-learning-mlflow"
201+
And a dictionary and 0 or more record models
202+
When the profile "aissemble-maven-modules" is generated
203+
Then the pipeline's child POMs have a dependency on "cucumber-reporting"
204+
And the pipeline's child POMs has the plugin "maven-cucumber-reporting"
205+
197206
@pipeline-generation @module-generation
198207
Scenario: Pipelines depend on data module by default - two language support
199208
Given a project named "example"

0 commit comments

Comments
 (0)