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

feat: temporarily inject examples for mutually-exclusive request types in c8 api docs #4352

Closed
wants to merge 2 commits into from

Conversation

pepopowitz
Copy link
Collaborator

@pepopowitz pepopowitz commented Sep 25, 2024

Description

Follow-up to #4308 (comment).

  • Temporarily injects example requests for two endpoints, each of which has requests that contain mutually exclusive fields.
  • Also removes a description hack we were using for an unrelated field, because it's no longer needed.

Following this PR, I'll open one at the camunda/camunda repo, to add these examples at the source. It won't be merged until after the release though, due to the current code freeze. Thus, this temporary hack, so that we don't have to keep modifying the spec when generating the docs for now.

What the added examples look like

Create process instance endpoint

image image

Evaluate decision endpoint

image image

When should this change go live?

  • This is a bug fix, security concern, or something that needs urgent release support.
  • This is already available but undocumented and should be released within a week.
  • This on a specific schedule and the assignee will coordinate a release with the DevEx team. (apply hold label or convert to draft PR)
  • This is part of a scheduled alpha or minor. (apply alpha or minor label)
  • There is no urgency with this change and can be released at any time.

PR Checklist

  • My changes are for an already released minor and are in /versioned_docs directory.
  • My changes are for the next minor and are in /docs directory (aka /next/).

@pepopowitz pepopowitz added the dx Documentation infrastructure typically handled by the Camunda DX team label Sep 25, 2024
@pepopowitz pepopowitz self-assigned this Sep 25, 2024
Copy link
Contributor

👋 🤖 🤔 Hello! Did you make your changes in all the right places?

These files were changed only in docs/. You might want to duplicate these changes in versioned_docs/version-8.5/.

  • docs/apis-tools/camunda-api-rest/specifications/activate-jobs.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/assign-user-task.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/broadcast-signal.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/cancel-process-instance.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/complete-job.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/complete-user-task.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/correlate-a-message.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/create-document-link-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/create-process-instance.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/create-user.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/delete-document-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/delete-resource.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/deploy-resources.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/download-document-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/evaluate-decision.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/fail-job.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/find-all-users.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/get-cluster-topology.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/get-decision-definition-xml-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/get-status-of-camunda-license.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/migrate-process-instance.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/modify-process-instance.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/patch-authorization.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/pin-internal-clock.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/publish-a-message.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/query-decision-definitions-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/query-decision-requirements-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/query-flow-node-instances-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/query-incidents-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/query-process-instances-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/query-user-tasks-alpha.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/report-error-for-job.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/reset-internal-clock.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/resolve-incident.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/sidebar.js
  • docs/apis-tools/camunda-api-rest/specifications/unassign-user-task.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/update-a-job.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/update-element-instance-variables.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/update-user-task.api.mdx
  • docs/apis-tools/camunda-api-rest/specifications/upload-document-alpha.api.mdx

You may have done this intentionally, but we wanted to point it out in case you didn't. You can read more about the versioning within our docs in our documentation guidelines.

@pepopowitz pepopowitz requested review from jwulf, tmetzke, akeller and a team September 25, 2024 20:53
@@ -4,7 +4,18 @@ const outputDir = "docs/apis-tools/camunda-api-rest/specifications";
const specFile = "api/camunda/camunda-openapi.yaml";

function preGenerateDocs() {
hackChangesetDescription();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This description hack is no longer needed!

Copy link
Member

Choose a reason for hiding this comment

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

🥳

Comment on lines +31 to +51
function temporarilyAddCreateProcessInstanceExamples() {
// This is a temporary hack, to add example requests to the `Create Process Instance` endpoint.
// After the upcoming release, this will be incorporated into the source spec, but the source spec is currently frozen.
return {
from: /\$ref: "#\/components\/schemas\/CreateProcessInstanceRequest"\n responses:/m,
to: `$ref: "#/components/schemas/CreateProcessInstanceRequest"
examples:
"By process decision key":
summary: "Create a process instance by processDefinitionKey."
value:
processDefinitionKey: 12345
variables: {}
"By BPMN process ID":
summary: "Create a process instance by bpmnProcessID and version."
value:
bpmnProcessId: "1234-5678"
version: 1
variables: {}
responses:`,
};
}
Copy link
Member

Choose a reason for hiding this comment

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

I'll backport the changes into the release branch. This shouldn't be necessary then, I guess?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@tmetzke tmetzke left a comment

Choose a reason for hiding this comment

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

Great examples, thanks a lot, @pepopowitz 🦕
The hacks for the examples can be removed, I think. I'll add the source changes to the release branch as well.

Edit: examples integrated in the source, also on release branch (with camunda/camunda#22715)

@pepopowitz
Copy link
Collaborator Author

Great examples, thanks a lot, @pepopowitz 🦕 The hacks for the examples can be removed, I think. I'll add the source changes to the release branch as well.

Edit: examples integrated in the source, also on release branch (with camunda/camunda#22715)

Nice, thanks @tmetzke!!! I didn't expect that this would be backport-worthy, and I thought I'd have to wait until the freeze thawed.

Closing!!! I'll address the removal of hackChangesetDescription in another upcoming PR. (It currently has no effect, so there's no harm in leaving it.)

@pepopowitz pepopowitz closed this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Documentation infrastructure typically handled by the Camunda DX team
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants