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

chore: add self serve action to enable specs based service virtualization #715

Open
wants to merge 65 commits into
base: main
Choose a base branch
from

Conversation

OmarAlJarrah
Copy link
Contributor

@OmarAlJarrah OmarAlJarrah commented Sep 3, 2024

No description provided.

@OmarAlJarrah OmarAlJarrah requested a review from a team as a code owner September 3, 2024 21:21
@OmarAlJarrah OmarAlJarrah changed the title chore: add action to enable specs based service virtualization chore: add self serve action to enable specs based service virtualization Sep 3, 2024
OmarAlJarrah and others added 20 commits September 24, 2024 15:25
This new workflow defines steps to download required artifacts, generate test sources using Maven, and upload the generated sources. Inputs for artifact keys, product namespace, and generation options are configurable, ensuring flexibility in different scenarios.
Deleted `selfserve-service-mock.yaml` workflow file and replaced it with a more detailed `selfserve-run-mocked-service-tests.yaml` workflow for running mocked service tests. Updated artifact and SDK configurations in run-tests and template files for consistency.
…tion

This commit consolidates various steps for downloading, transforming, and uploading specs into more streamlined workflows. New steps for generating contract tests and running example tests have been added, targeting the 'rapid' namespace. Additionally, template files have been updated to use consistent property keys for SDK configurations.
This commit introduces two required secrets, KEY and SECRET, to the GitHub Actions workflow. These secrets are necessary for securely accessing API keys during the execution of mocked service tests. This enhances the workflow's security and ensures proper authentication.
Correct dependencies to reflect accurate prerequisite steps for generating contract tests. This change ensures the workflow uses the outputs from 'generate-test-sdk' instead of 'transform-and-upload-specs', 'upload-templates', and 'upload-repo'.
Add a new step to install the SDK Generator Module in the workflow. This ensures that the generator dependencies are available before generating test sources.
Add setup-java action to configure Java 21 with Corretto distribution. This ensures the correct Java version is available during the workflow execution.
Updated the path for the specs.yaml file in the GitHub Actions workflow to ensure the correct file is used. This change helps in locating the specification file correctly for generating test sources.
Updated the path for the specs.yaml file in the GitHub Actions workflow to ensure the correct file is used. This change helps in locating the specification file correctly for generating test sources.
Updated artifacts' download paths and job names to use dynamic inputs. This ensures the workflow can handle various specs_keys correctly and improves naming clarity.
Adjusted artifact download and input spec paths in the GitHub workflow for generating contract test sources. This ensures consistency in file handling and correct execution of the Maven command.
Add ArtifactMetadata class and integrate it into CLI and SdkTestGenerator. Update GitHub workflow to support new target artifact parameters and modify templates to use dynamic target SDK data.
Add sdk_artifact_id as a new input parameter in run-tests.yaml workflow.
This ensures the artifactId is configurable and defaults to 'rapid-sdk'.
Added a test step in the selfserve-generate-contract-test-sources.yaml workflow to list directory contents. This is intended for debugging purposes and includes a TODO comment to remove it later.
Updated the GitHub workflow to include an upload step for test templates. Changed the key for templates in the upload-repo step to ensure correct artifact management.
Changed the artifact name from a dynamic input to a static 'sdk-test' for clarity and consistency. This ensures that the uploaded artifact is always named 'sdk-test' regardless of the input provided.
OmarAlJarrah and others added 30 commits September 30, 2024 13:26
Adjust the upload path to include all nested directories and files. This change ensures that all generated sources are correctly uploaded without omission.
Update the test command in the workflow to pass SDK key and secret from GitHub secrets. This ensures secure handling of sensitive information during the test execution.
Modify the "Upload Generated Sources" step to use 'find' command for specifying the artifact path. This change ensures that all relevant files are included correctly.
Modified the upload path in the selfserve-generate-contract-test-sources workflow to use a more inclusive glob pattern. This change improves the accuracy of the file selection for artifact uploading.
Change the working directory for running tests to a specific pattern. This ensures tests are executed in the correct subdirectory.
Adjusted the workflow to change the working directory and include a directory change command before running tests. This ensures the proper context is set for the Maven commands to execute correctly.
Add an 'ls' command before the test execution in the GitHub workflow. This helps debug the workflow by listing directory contents, ensuring the correct path for subsequent commands.
Change the working directory path to dynamically locate the "*-sdk-test" folder. This ensures that the CI pipeline runs correctly even if the test folder name changes. Simplifies the workflow script by removing redundant commands.
Change the working directory path to dynamically locate the "*-sdk-test" folder. This ensures that the CI pipeline runs correctly even if the test folder name changes. Simplifies the workflow script by removing redundant commands.
Added com.google.guava dependency to pom.mustache file. Updated file resource path in main.mustache to use Guava's Resources utility for better resource handling.
Remove unnecessary SDK artifact and version inputs from GitHub workflows. This streamlines the YAML files, reducing complexity and potential errors.
Change the method from `asText()` to `toPrettyString()` for reading JSON value. This ensures better formatting and readability when processing the request.
Remove unnecessary ls command from workflow file to clean up actions. Add `@JsonDeserialize` annotation to data class template for better JSON processing.
Include JsonDeserialize from com.fasterxml.jackson.databind.annotation in data_class.mustache template. This change ensures proper deserialization handling of the generated data classes.
This commit eliminates the `@JsonDeserialize` annotation in the `data_class.mustache` template file. The change simplifies data class generation and removes unnecessary dependencies on Jackson's `JsonDeserialize` functionality.
Refactor jacksonObjectMapper configuration in executor and main templates. This consolidates deserialization feature settings to ensure consistent handling of nullable and missing properties across both files.
Introduced DeserializationFeature and KotlinFeature imports to support enhanced JSON processing. These imports will facilitate more robust data deserialization within the template.
Introduced DeserializationFeature and KotlinFeature imports to support enhanced JSON processing. These imports will facilitate more robust data deserialization within the template.
Removed multiple disable calls on jacksonObjectMapper configuration. This change streamlines the code and relies on default settings instead.
Added @JvmStatic annotations to singleton objects in executor.mustache and main.mustache templates. This ensures proper static access from Java, enhancing compatibility and performance. It also improves interoperation between Kotlin and Java codebases.
Updated request deserialization to handle multiple node types (body, pathParams, queryParams, headers, params) for better flexibility. Improved error handling maintains original response status codes for non-200 responses.
Changed endpoint from "localhost:8080" to "http://localhost:8080". This ensures the URL is fully qualified and adheres to standard formatting conventions.
Updated the Java version to 21 and added a missing setup step in the workflow. This ensures compatibility and proper environment configuration for running mocked service tests.
Added a step to transform specs using the @expediagroup/spec-transformer in the GitHub workflow. Also removed the mapdb dependency from the pom.mustache template to clean up unused dependencies.
Added a step to setup Node.js 18.18.2 in the selfserve run mocked service tests GitHub workflow. This ensures that the required Node.js environment is correctly configured for the tests.
Modified the path for downloading specs in the selfserve-run-mocked-service-tests workflow. This change removes the filename specification, simplifying the target directory to just "specs".
Added jackson-datatype-jsr310 dependency to support Java time module. Updated executor.mustache to register JavaTimeModule, ensuring proper deserialization of Java 8 Date/Time API objects.
Added @JsonProperty annotation to ensure correct JSON serialization for enum variables. This change improves code readability and aligns with JSON processing standards.
Added a type mapping from java.io.File to java.io.InputStream in the OpenApiSdkGenerator. This change enhances type compatibility and improves the handling of file streams in the generated SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants