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

Release candidate/2024 07 #142

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Release candidate/2024 07 #142

merged 2 commits into from
Jul 17, 2024

Conversation

rohanshah18
Copy link
Contributor

@rohanshah18 rohanshah18 commented Jul 17, 2024

Problem

Add deletion protection and generate code based on latest open api spec.

Solution

Generated code based on 2024-07 open api spec which includes deletion protection support. Manually added deletion protection support to the control plane wrapper along with integration tests.

Type of Change

  • New feature (non-breaking change which adds functionality)

Test Plan

Added integration tests

jhamon and others added 2 commits July 10, 2024 11:46
## Problem

Need to update generated code for the upcoming 2024-07 API release.

## Solution

This PR closely follows the approach used in the python and typescript
repositories.

- I create a new `codegen` directory to act as the home for everything
codegen related. Inside this directory there are several things:
  - Git submodule of our apis repo
- A `build-oas.sh` script which does everything to generate the code off
the spec

The script does the following:
- Pulls in the latest from the apis repo
- Builds the api repo to produce versioned spec files
- Generates java code off the spec file.
- Copies files into their respective places in `src/`

Run the script like this, passing api version number as a positional
argument:

```sh
./codegen/build-oas.sh 2024-07
```

## Non-generated changes

The updated spec produced slightly different generated code than in the
past. In order for the project to compile, I had to make some
adjustments:

- Options for metric type are now part of the `IndexModel` class instead
of a standalone metric object, requiring a small refactor along the
lines of `IndexMetric.COSINE.toString()` to
`IndexModel.MetricEnum.COSINE.toString()` and similar for other metric
types.
- The name and organization of create index spec objects has changed.
Now you use:
  - `IndexSpec` instead of `CreateInexRequestSpec`.
  - `PodSpec` instead of `CreateIndexRequestSpecPod`
- `PodSpecMetadataConfig` instead of
`CreateIndexRequestSpecPodMetadataConfig`

## Type of Change

- [x] None of the above: Update generated core, adjust usage for new
generated classes

## Test Plan

Code builds and tests pass
## Problem

Add support for deletion protection.

## Solution

Generated code using the following commands: 
```
git submodule init && git submodule update
./codegen/build-oas.sh 2024-07
```
Next, as a part of this PR, I have: 
1. Added deletionProtection enum as an argument to createPodsIndex() and
createServerlessIndex()
2. Renamed configureIndex() to configurePodsIndex() and added
deletionProtection enum as an argument.
3. Added configureServerlessIndex() that accepts deletionProtection enum
only.


## Type of Change

- [X] New feature (non-breaking change which adds functionality)

## Test Plan

Added integration tests
@rohanshah18 rohanshah18 marked this pull request as ready for review July 17, 2024 19:48
@rohanshah18 rohanshah18 merged commit ddc00b8 into main Jul 17, 2024
7 of 8 checks passed
@rohanshah18 rohanshah18 deleted the release-candidate/2024-07 branch July 17, 2024 20:00
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