diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index 5fd9bfa..f63fb8b 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -24,57 +24,26 @@ jobs: with: fetch-depth: 0 - - name: Get changed files - id: changed-files - run: | - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) - else - CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) - fi - echo "CHANGED_FILES<> $GITHUB_ENV - echo "$CHANGED_FILES" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - name: Set matrix id: set-matrix run: | DOCS=() - - # Check for changes in API doc folders - if echo "$CHANGED_FILES" | grep -q "^admin/"; then - DOCS+=("admin") - fi - if echo "$CHANGED_FILES" | grep -q "^cloud-controlplane/"; then - DOCS+=("cloud-controlplane") - fi - if echo "$CHANGED_FILES" | grep -q "^cloud-dataplane/"; then - DOCS+=("cloud-dataplane") - fi - if echo "$CHANGED_FILES" | grep -q "^schema-registry/"; then - DOCS+=("schema-registry") - fi - if echo "$CHANGED_FILES" | grep -q "^http-proxy/"; then - DOCS+=("http-proxy") - fi - # Check for changes in shared resources that might affect all docs - if echo "$CHANGED_FILES" | grep -q "^shared/"; then - if [ ${#DOCS[@]} -eq 0 ]; then - # If only shared files changed and no specific doc files, include all docs - DOCS+=("admin" "cloud-controlplane" "cloud-dataplane" "schema-registry" "http-proxy") + for d in */ ; do + # Exclude shared and .github or any other non-doc folders + if [[ "$d" != "shared/" && "$d" != ".github/" && ( -f "${d%/}/${d%/}.yaml" || -f "${d%/}/${d%/}.json" ) ]]; then + DOCS+=("${d%/}") fi - fi + done - # If no files changed in any monitored directories, abort the workflow + # If no doc folders found, abort the workflow if [ ${#DOCS[@]} -eq 0 ]; then - echo "No relevant files were changed. Exiting workflow." + echo "No doc folders found. Exiting workflow." echo "matrix={\"doc_id\":[]}" >> $GITHUB_OUTPUT exit 0 fi - # Convert bash array to JSON array for GitHub Actions matrix JSON_ARRAY=$(printf '"%s",' "${DOCS[@]}" | sed 's/,$//') - JSON_MATRIX="{\"doc_id\":[$JSON_ARRAY]}" + JSON_MATRIX="{\"doc_id\":[${JSON_ARRAY}]}" echo "matrix=$JSON_MATRIX" >> $GITHUB_OUTPUT echo "Created matrix: $JSON_MATRIX" @@ -107,35 +76,39 @@ jobs: run: | OVERLAYS="" - # Check for doc-specific overlays + # Add doc-specific overlays (if any) if [ -d "${{ matrix.doc_id }}/overlays" ]; then + shopt -s nullglob for overlay_file in "${{ matrix.doc_id }}/overlays"/*.yaml; do if [ -f "$overlay_file" ]; then - if [ -n "$OVERLAYS" ]; then - OVERLAYS="$OVERLAYS,$overlay_file" - else - OVERLAYS="$overlay_file" - fi + OVERLAYS="${OVERLAYS:+$OVERLAYS,}$overlay_file" fi done + shopt -u nullglob fi - # Check for shared overlays - only apply to cloud APIs - if [[ "${{ matrix.doc_id }}" == "cloud-"* ]] && [ -d "shared/overlays" ]; then - for overlay_file in shared/overlays/*.yaml; do + # Determine shared overlay prefix + if [[ "${{ matrix.doc_id }}" == "cloud-"* ]]; then + OVERLAY_PREFIX="cloud-" + else + OVERLAY_PREFIX="sm-" + fi + + # Add matching shared overlays + if [ -d "shared/overlays" ]; then + shopt -s nullglob + for overlay_file in shared/overlays/${OVERLAY_PREFIX}*.yaml; do if [ -f "$overlay_file" ]; then - if [ -n "$OVERLAYS" ]; then - OVERLAYS="$OVERLAYS,$overlay_file" - else - OVERLAYS="$overlay_file" - fi + OVERLAYS="${OVERLAYS:+$OVERLAYS,}$overlay_file" fi done + shopt -u nullglob fi echo "overlay_paths=$OVERLAYS" >> $GITHUB_OUTPUT echo "Using overlays: $OVERLAYS" + - name: Deploy API documentation uses: bump-sh/github-action@v1 with: @@ -150,7 +123,7 @@ jobs: api-diff: if: ${{ github.event_name == 'pull_request' && fromJson(needs.determine-doc-ids.outputs.matrix).doc_id[0] != null }} needs: determine-doc-ids - name: Check API diff on Bump.sh + name: Check diff runs-on: ubuntu-latest strategy: matrix: ${{fromJson(needs.determine-doc-ids.outputs.matrix)}} @@ -178,35 +151,39 @@ jobs: run: | OVERLAYS="" - # Check for doc-specific overlays + # Add doc-specific overlays (if any) if [ -d "${{ matrix.doc_id }}/overlays" ]; then + shopt -s nullglob for overlay_file in "${{ matrix.doc_id }}/overlays"/*.yaml; do if [ -f "$overlay_file" ]; then - if [ -n "$OVERLAYS" ]; then - OVERLAYS="$OVERLAYS,$overlay_file" - else - OVERLAYS="$overlay_file" - fi + OVERLAYS="${OVERLAYS:+$OVERLAYS,}$overlay_file" fi done + shopt -u nullglob fi - # Check for shared overlays - only apply to cloud APIs - if [[ "${{ matrix.doc_id }}" == "cloud-"* ]] && [ -d "shared/overlays" ]; then - for overlay_file in shared/overlays/*.yaml; do + # Determine shared overlay prefix + if [[ "${{ matrix.doc_id }}" == "cloud-"* ]]; then + OVERLAY_PREFIX="cloud-" + else + OVERLAY_PREFIX="sm-" + fi + + # Add matching shared overlays + if [ -d "shared/overlays" ]; then + shopt -s nullglob + for overlay_file in shared/overlays/${OVERLAY_PREFIX}*.yaml; do if [ -f "$overlay_file" ]; then - if [ -n "$OVERLAYS" ]; then - OVERLAYS="$OVERLAYS,$overlay_file" - else - OVERLAYS="$overlay_file" - fi + OVERLAYS="${OVERLAYS:+$OVERLAYS,}$overlay_file" fi done + shopt -u nullglob fi echo "overlay_paths=$OVERLAYS" >> $GITHUB_OUTPUT echo "Using overlays: $OVERLAYS" + - name: Comment pull request with API diff uses: bump-sh/github-action@v1 with: diff --git a/admin/admin.yaml b/admin/admin.yaml index 1e11e8d..89e5fd0 100644 --- a/admin/admin.yaml +++ b/admin/admin.yaml @@ -6059,4 +6059,4 @@ tags: - name: Services description: Manage Redpanda services. - name: Unstable APIs - description: Developmental APIs that are subject to change. \ No newline at end of file + description: Developmental APIs that are subject to change. diff --git a/cloud-controlplane/overlays/add-x-topics.yaml b/cloud-controlplane/overlays/add-x-topics.yaml index f66b445..6670b66 100644 --- a/cloud-controlplane/overlays/add-x-topics.yaml +++ b/cloud-controlplane/overlays/add-x-topics.yaml @@ -17,7 +17,7 @@ actions: $ref: ../../shared/x-topics/cloud-api-overview.md - title: Authentication content: - $ref: ../../shared/x-topics/about-authentication.md + $ref: ../../shared/x-topics/cloud-about-authentication.md - title: Regions and Usage Tiers content: $ref: ../x-topics/cloud-regions.md diff --git a/cloud-controlplane/x-topics/quickstart.md b/cloud-controlplane/x-topics/quickstart.md index a37b6cb..14e3c43 100644 --- a/cloud-controlplane/x-topics/quickstart.md +++ b/cloud-controlplane/x-topics/quickstart.md @@ -91,10 +91,10 @@ If you successfully retrieve an access token, it is valid for one hour. You can 1. Select an operation, for example **Create topic** or **List users**. 1. In the URL field, add the data plane API URL. You can now make Data Plane API requests to your target cluster. -See also: [Data Plane API Quickstart](/cloud-dataplane/topic/topic-quickstart) +See also: [Data Plane API Quickstart](/api/doc/cloud-dataplane/topic/topic-quickstart) ## Suggested reading - Learn about Redpanda Cloud [network security and connectivity](https://docs.redpanda.com/redpanda-cloud/networking/) for BYOC and Dedicated clusters. - Manage [authentication and authorization](https://docs.redpanda.com/redpanda-cloud/security/authorization/) in Redpanda Cloud. -- [Create a Kafka client or generate a sample application](https://docs.redpanda.com/redpanda-cloud/get-started/cluster-types/serverless/#connect-with-your-cluster) to interact with your Serverless cluster. \ No newline at end of file +- [Create a Kafka client or generate a sample application](https://docs.redpanda.com/redpanda-cloud/get-started/cluster-types/serverless/#connect-with-your-cluster) to interact with your Serverless cluster. diff --git a/cloud-dataplane/overlays/add-x-topics.yaml b/cloud-dataplane/overlays/add-x-topics.yaml index ae8ea16..e489f49 100644 --- a/cloud-dataplane/overlays/add-x-topics.yaml +++ b/cloud-dataplane/overlays/add-x-topics.yaml @@ -17,7 +17,7 @@ actions: $ref: ../../shared/x-topics/cloud-api-overview.md - title: Authentication content: - $ref: ../../shared/x-topics/about-authentication.md + $ref: ../../shared/x-topics/cloud-about-authentication.md - title: Error and Status Codes content: $ref: ../x-topics/error-and-status-codes.md diff --git a/http-proxy/http-proxy.json b/http-proxy/http-proxy.json index 470a40f..4d427a3 100644 --- a/http-proxy/http-proxy.json +++ b/http-proxy/http-proxy.json @@ -570,4 +570,4 @@ } } } -} \ No newline at end of file +} diff --git a/schema-registry/schema-registry.json b/schema-registry/schema-registry.json index cae3b0f..7558f03 100644 --- a/schema-registry/schema-registry.json +++ b/schema-registry/schema-registry.json @@ -1661,4 +1661,4 @@ } } } -} \ No newline at end of file +} diff --git a/shared/overlays/cloud-add-feedback-link.yaml b/shared/overlays/cloud-add-feedback-link.yaml new file mode 100644 index 0000000..f2c509e --- /dev/null +++ b/shared/overlays/cloud-add-feedback-link.yaml @@ -0,0 +1,15 @@ +# Overlay to add feedback link to the API specification +# This adds a feedback button in the Control Plane and Data Plane API docs +# for users to report issues through GitHub + +overlay: 1.0.0 +info: + title: Add Feedback Link + version: 1.0.0 +actions: + # Add x-feedbackLink to the top-level info element + - target: "$.info" + update: + x-feedbackLink: + label: "Share feedback" + url: "https://github.com/redpanda-data/cloud-docs/issues/new?template=01_doc_request.yml" diff --git a/shared/overlays/update-securityschemes-for-authentication.yaml b/shared/overlays/cloud-update-securityschemes-for-authentication.yaml similarity index 100% rename from shared/overlays/update-securityschemes-for-authentication.yaml rename to shared/overlays/cloud-update-securityschemes-for-authentication.yaml diff --git a/shared/overlays/sm-add-feedback-link.yaml b/shared/overlays/sm-add-feedback-link.yaml new file mode 100644 index 0000000..e9d63d1 --- /dev/null +++ b/shared/overlays/sm-add-feedback-link.yaml @@ -0,0 +1,15 @@ +# Overlay to add feedback link to the API specification +# This adds a feedback button in the HTTP Proxy, Schema Registry, and Admin API docs +# for users to report issues through GitHub + +overlay: 1.0.0 +info: + title: Add Feedback Link + version: 1.0.0 +actions: + # Add x-feedbackLink to the top-level info element + - target: "$.info" + update: + x-feedbackLink: + label: "Share feedback" + url: "https://github.com/redpanda-data/docs/issues/new?template=01_doc_request.yml" diff --git a/shared/x-topics/about-authentication.md b/shared/x-topics/cloud-about-authentication.md similarity index 100% rename from shared/x-topics/about-authentication.md rename to shared/x-topics/cloud-about-authentication.md