Skip to content

Commit a5b66f6

Browse files
authored
Merge pull request #10 from cisco-open/add_contribution_guidelines
Added Contributing guidelines and some minor renaming
2 parents fdb9062 + e286348 commit a5b66f6

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Contributing
2+
3+
We love pull requests from everyone, especially if they are to expand the available functionality or address one of the [open issues](https://github.com/cisco-open/test-telemetry-generator/issues). You will need the following to start with:
4+
* Github access, obviously
5+
* JDK 11
6+
* Gradle 5.6.4 or above
7+
8+
Once you have the above setup:
9+
* Clone the project
10+
* Create a new branch on your local machine
11+
* Make the changes and add tests for your changes
12+
* Run all tests in your local using
13+
`./gradlew clean build test` for Linux/Mac
14+
`gradlew.bat clean build test` for Windows
15+
Doing this in local will ensure that the tests pass on the Github workflow too
16+
* Push your branch and open a pull request with a good description of the changes being made
17+
* Someone will review and we may suggest some changes, improvements or alternatives
18+
19+
Thank you and happy coding!

src/main/java/io/opentelemetry/contrib/generator/telemetry/cli/CLIProcessor.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private static Options getOptions() {
7979
.desc("Path to the trace definition YAML")
8080
.hasArg()
8181
.build();
82-
Option cisTargetYAML = Option.builder("t")
82+
Option targetEnvYAML = Option.builder("t")
8383
.argName("target")
8484
.desc("Path to the YAML containing details of the environment to target")
8585
.hasArg()
@@ -90,15 +90,15 @@ private static Options getOptions() {
9090
options.addOption(metricDefinition);
9191
options.addOption(logsDefinition);
9292
options.addOption(traceDefinition);
93-
options.addOption(cisTargetYAML);
93+
options.addOption(targetEnvYAML);
9494

9595
HelpFormatter formatter = new HelpFormatter();
9696
formatter.printHelp("test-telemetry-generator-all.jar", options, true);
9797
return options;
9898
}
9999

100-
private static PayloadHandler getPayloadHandler(String cisTargetYAML) {
101-
TargetEnvironmentDetails targetEnvironmentDetails = getCISTargetDetails(cisTargetYAML);
100+
private static PayloadHandler getPayloadHandler(String targetEnvYAML) {
101+
TargetEnvironmentDetails targetEnvironmentDetails = getTargetEnvDetails(targetEnvYAML);
102102
if (StringUtils.defaultString(targetEnvironmentDetails.getUsername()).isBlank()) {
103103
throw new GeneratorException("Missing username in environment target YAML");
104104
}
@@ -126,17 +126,17 @@ private static PayloadHandler getPayloadHandler(String cisTargetYAML) {
126126
new BasicAuthHandler(targetEnvironmentDetails.getUsername(), targetEnvironmentDetails.getPassword()));
127127
}
128128

129-
private static TargetEnvironmentDetails getCISTargetDetails(String cisTargetYAML) {
130-
File yamlFile = new File(cisTargetYAML);
129+
private static TargetEnvironmentDetails getTargetEnvDetails(String targetEnvYAML) {
130+
File yamlFile = new File(targetEnvYAML);
131131
if (!(yamlFile.exists() && yamlFile.canRead())) {
132-
throw new GeneratorException("Unable to read provided CIS target YAML file " + cisTargetYAML);
132+
throw new GeneratorException("Unable to read provided target environment YAML file " + targetEnvYAML);
133133
}
134134

135135
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
136136
try {
137137
return mapper.readValue(yamlFile, TargetEnvironmentDetails.class);
138138
} catch (IOException e) {
139-
throw new GeneratorException("Failed to parse CIS target details YAML " + cisTargetYAML + " due to " + e.getMessage());
139+
throw new GeneratorException("Failed to parse target environment details YAML " + targetEnvYAML + " due to " + e.getMessage());
140140
}
141141
}
142142

src/main/java/io/opentelemetry/contrib/generator/telemetry/logs/dto/LogDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class LogDefinition {
4040

4141
public long validate(String requestID, Set<String> allEntityTypes, Integer globalPayloadFrequencySeconds) {
4242
if (StringUtils.defaultString(name).isBlank()) {
43-
name = "log_by_vodka_" + ThreadLocalRandom.current().nextInt();
43+
name = "log_by_ttg_" + ThreadLocalRandom.current().nextInt();
4444
log.warn("Name not found for log. Using " + name);
4545
}
4646
if (copyCount == null || copyCount < 1) {

0 commit comments

Comments
 (0)