Skip to content

F gpu 2196 - #1750

Open
plyhun wants to merge 75 commits into
devfrom
f-gpu-2196
Open

F gpu 2196#1750
plyhun wants to merge 75 commits into
devfrom
f-gpu-2196

Conversation

@plyhun

@plyhun plyhun commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Abstract

Checklist

General

  • Added abstract that describes the change
  • Added changelog entry to /CHANGELOG.adoc
  • Ensured that the change is covered by tests
  • Ensured that the change is documented in the docs

On API Changes

  • Checked if the changes are breaking or not
  • Added GraphQL API if applicable
  • Added Elasticsearch mapping if applicable

@plyhun
plyhun requested a review from npomaroli March 3, 2026 13:14
@JsonProperty(required = false)
@JsonPropertyDescription("Should the endpoints of the included plugins be excluded from the OpenAPI specification generation requests. Default is true.")
@EnvironmentVariable(name = MESH_OPENAPI_EXCLUDE_PLUGINS_ENV, description = "Override the flag to exclude endpoints of the plugins from the OpenAPI specification generation requests")
private boolean openapiExcludePlugins = true;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we exclude plugins by default?

revokePermissionsEndpoint.exampleRequest(roleExamples.getObjectPermissionRevokeRequest(includePublishPermissions));
revokePermissionsEndpoint.exampleResponse(OK, roleExamples.getObjectPermissionResponse(includePublishPermissions), "Updated permissions.");
revokePermissionsEndpoint.events(ROLE_PERMISSIONS_CHANGED);
revokePermissionsEndpoint.setHidden(true);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DELETE request with a body are not allowed in the v3.0 specification, so while the direct http calls will still work, we hide this from the generator and redefine an identical PUT request below.

* @throws OpenAPIGenerationException
*/
public void run() throws IOException, OpenAPIGenerationException {
String yaml = generate("yaml");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Generate yaml to be consistent with RAML generator output.

}, isOrderedBlockingHandlers());

InternalEndpointRoute readEndpoint = createRoute();
readEndpoint.path("/plugins/:uuid");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not a UUID


secure("/");
InternalEndpointRoute infoEndpoint = createRoute();
infoEndpoint.setInsecure(true);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is actually accessible with no auth, giving back different info for anonymous user.

crudHandler.handleSetLatest(ac, uuid);
}, isOrderedBlockingHandlers());

InternalEndpointRoute upsertBranch = createRoute();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here we explicitly tell apart update and upsert EPs for all models, since the specification requires different body models for create and update actions. The backwards compatibility is kept.

revokePermissionsEndpoint.exampleResponse(OK, roleExamples.getObjectPermissionResponse(false), "Updated permissions.");
revokePermissionsEndpoint.events(ROLE_PERMISSIONS_CHANGED);
revokePermissionsEndpoint.blockingHandler(rc -> {
InternalEndpointRoute revokePermissionsEndpointNonStandard = createRoute();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DELETE method with a body is not allowed by a spec.

import java.util.stream.Stream;

import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Using other JSON implementation is awkward.

}
config.setInstanceName(options.getNodeName());
config.setClusterName(options.getClusterOptions().getClusterName());
config.setClusterName(Optional.ofNullable(options.getClusterOptions().getClusterName()).orElseGet(() -> options.getNodeName()));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Null safety.

String format = formatConf.name().toLowerCase();

// Collect available servers
HttpServerConfig httpServerConfig = options.getHttpServerOptions();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can be reverted, if considered a vulnerability.

defaultMapper = JsonMapper.builder(new JsonFactoryBuilder()
.streamReadConstraints(StreamReadConstraints.builder().maxStringLength(Integer.MAX_VALUE).build())
.build())
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already used (at least) in the tests, so formalized for the model generation.

@@ -26,6 +26,6 @@ default BackupParameters setConsistencyCheck(boolean flag) {
* @return
*/
default boolean isConsistencyCheck() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Null values were improperly processed with valueOf.

import io.vertx.core.json.JsonObject;

/**
* An upgrade to the generated DefaultAPI, overriding its generation problems

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even though the text/* string body is defined for the method in the spec, okhttp3-gson client generator forgets about it.

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