Skip to content

Remove global tests index.json file#894

Merged
jormundur00 merged 3 commits intomasterfrom
jormundur00/gh-848
Dec 19, 2025
Merged

Remove global tests index.json file#894
jormundur00 merged 3 commits intomasterfrom
jormundur00/gh-848

Conversation

@jormundur00
Copy link
Copy Markdown
Member

What does this PR do?

This PR streamlines the metadata management process by removing the redundant global test index (tests/src/index.json) and consolidating all test configuration functionality into the per-library metadata/<groupId>/<artifactId>/index.json files.

Key Changes

1. Removal of Redundant Global Test Index

  • File Removed: The global test index (tests/src/index.json) is deleted.
  • Rationale: This eliminates a source of redundant information and manual synchronization errors, simplifying the workflow for adding and changing metadata.

2. Consolidation and Introduction of the test-version Field

All functionality from the removed global index is moved to the per-library metadata index, facilitated by a new field.

Feature New Location/Field Functionality
Test Directory Mapping test-version (New Optional String) Overrides the default test directory derived from metadata-version. This allows multiple metadata configurations (e.g., across versions) to share a single, stable set of tests.
Data Integrity JSON Schema Update The metadata-library-index-schema-v1.0.0.json is updated to include the new test-version property, maintaining schema validation integrity for the modified files.

3. Automated Maintenance and Integrity

The process for updating metadata is made more robust through new automation:

  • Pre-Release Migration: The TestedVersionUpdaterTask is updated to automatically handle test-version propagation. When a pre-release metadata directory is renamed to its full release counterpart (e.g., 1.0.0-M1 $\rightarrow$ 1.0.0), any index entries that relied on the old directory via the test-version override are automatically updated to point to the new full release version.
  • Generation Default: The FixTestNativeImageRun Gradle task is updated to automatically set a default value for the test-version field when new library metadata is generated.

Prerequisites

This PR must only be merged after merging the schema update PR:


Fixes: #848

@jormundur00 jormundur00 requested a review from a team as a code owner December 16, 2025 08:57
@jormundur00 jormundur00 self-assigned this Dec 16, 2025
@jormundur00 jormundur00 added the enhancement New feature or request label Dec 16, 2025
.filter(s -> !s.isEmpty())
.filter(s -> !s.startsWith("#"))
.forEach(requiredImages::add);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably throw a GradleException if metadata version is not found.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata-version it defaults to must always be present in the index.json. The null check is there mostly to avoid warnings. We currently don't test this when adding new metadata, but will do this once the PR for schema validation is merged: #883.

"type": "object",
"additionalProperties": false,
"required": [
"module",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need module field in every entry of index.json? Can it differ between two entries in the same index.json?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As current functionality stands, we do need it in every entry. I don't think it can differ between two entries. I'll look into completely removing this field in a follow up PR for removing the metadata/index.json file.

The schema introduction I made in this PR has been removed, as I want to introduce all schemas in one uniform PR.

@jormundur00 jormundur00 merged commit 6d9c291 into master Dec 19, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Remove global tests index.json from the repository

3 participants