Skip to content

Add delete index support - #13

Merged
rohanshah18 merged 3 commits into
mainfrom
rohanshah/addDeleteIndex
Aug 18, 2023
Merged

rohanshah18 merged 3 commits into
mainfrom
rohanshah/addDeleteIndex

Conversation

@rohanshah18

Copy link
Copy Markdown
Contributor

Problem

The java client is missing delete index support, so this PR aims at adding the function to make http call to the delete index endpoint.

Solution

I've added the delete index client along with a unit test. As a follow up to this PR, I'll be adding an example to demonstrate how to consume the delete index client to the examples subfolder.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Describe specific steps for validating this change.
A unit test is added to test the functionality.

@rohanshah18
rohanshah18 requested review from jhamon and rajat08 August 17, 2023 14:35

@jhamon jhamon left a comment

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.

This looks like a good start. If you want to change the method signature (based on my feedback), I'm fine with handling that as a follow-up PR.

@rohanshah18
rohanshah18 merged commit d3879aa into main Aug 18, 2023
@rohanshah18
rohanshah18 deleted the rohanshah/addDeleteIndex branch August 18, 2023 14:52
jhamon added a commit that referenced this pull request Jul 14, 2026
## Summary
Resolves the three open CodeQL `actions/missing-workflow-permissions`
alerts (#6, #12, #13). Neither workflow declared explicit `permissions`,
so both used the repository-default `GITHUB_TOKEN` scope.

## Changes
- **pr.yml** → `permissions: contents: read` — the `build`,
`integration-test`, and `cleanup` jobs only build/test; they make no
writes via `GITHUB_TOKEN`.
- **build-and-publish-docs.yml** → `permissions: contents: read` — it
publishes Javadoc to the separate `sdk-docs` repo using
`SSH_DEPLOY_KEY`, not `GITHUB_TOKEN`, so it only needs to read this
repo.

## Verification
- YAML parses cleanly (`ruby -ryaml`).
- Token scope now matches actual operations; no behavior change.

Part of PIN-16 (security tail), child of PIN-6.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> CI YAML-only permission tightening with no application or
secret-handling logic changes; risk is mainly if a step later needed
write scope via `GITHUB_TOKEN` (none do today).
> 
> **Overview**
> Adds explicit **`permissions: contents: read`** to **`pr.yml`** and
**`build-and-publish-docs.yml`**, replacing the implicit default
`GITHUB_TOKEN` scope and clearing CodeQL
**`actions/missing-workflow-permissions`** findings.
> 
> **`pr.yml`** — build, integration-test, and cleanup only checkout and
run Gradle; they do not write to the repo via `GITHUB_TOKEN`, so
read-only contents access is sufficient.
> 
> **`build-and-publish-docs.yml`** — Javadoc is pushed to **`sdk-docs`**
with **`SSH_DEPLOY_KEY`**, not `GITHUB_TOKEN`; this workflow only needs
to read the Java client repo. Short comments in each file document that
rationale.
> 
> No job steps or secrets usage change; only the token permission
boundary is tightened.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0b1c51b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jhamon added a commit that referenced this pull request Nov 12, 2026
* ci: build once in pr.yml, cancel superseded runs, cap job time

- The build job's three Gradle steps (clean build, a no-op jar,
  compileIntegrationTestJava) become one `./gradlew build
  compileIntegrationTestJava`.
- The integration-test job no longer runs a redundant `clean build`; it runs
  only `./gradlew integrationTest`, which compiles what it needs.
- The cleanup job builds only `shadowJar` (3.7 s) instead of a clean build
  (14.7 s, measured locally).
- Every call uses the committed wrapper (pinned to Gradle 8.5), so the
  per-matrix gradle-version inputs are gone and the matrix is a plain list.
- A top-level concurrency group cancels a PR's older run on a new push.
  Pushes to main and manual dispatches get one group per run. A cancelled
  run still runs its always() cleanup, which deletes only that run's
  resources.
- timeout-minutes on every job: build 20, integration-test 45, cleanup 15.

Verified: offline build green (97 unit tests); actionlint and a YAML
parse pass. The workflow has not run in CI yet.

* test: run pod-index tests only on opt-in

Pod indexes count against a per-project pod quota (20 for the CI project).
Several PR runs at once exhaust it and fail with 403 "You've reached the
max pods allowed in project". The 7 classes that create or use a pod index
are now @tag("pod"), and integrationTest excludes that tag unless Gradle
gets -PincludePodTests=true. The nightly full suite passes the flag; PR CI
needs no workflow change. The shared pod fixture in TestResourcesManager is
created lazily, and only pod-tagged classes ask for it.

Tagged: pod/CollectionTest, pod/ConfigureIndexTest,
pod/CreateDescribeListAndDeleteIndexTest, pod/DeletionProtectionTest,
UpdateFetchAndQueryPodTest, UpsertAndQueryPodTest,
UpsertDescribeIndexStatsAndDeletePodTest.

Verified: offline build green (97 unit tests). Live on a disposable
project: default integrationTest 72/72 in 248 s, 0 pod classes run, pod
count unchanged at its pre-existing 6. With -PincludePodTests=true
--tests '*UpsertAndQueryPodTest': 4/4, pod count 6 -> 7 -> 6.
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.

3 participants