Skip to content

feat: publish docs from repo #58

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

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

Conversation

tomlongridge
Copy link
Contributor

Goal

To keep the docs in developer.smartbear.com in sync with our readme and easy to update with changes to the tools, the content is now in markdown in this repo and pushes to main will publish the live docs (with changes to next going to the internal staging area).

Design

Scripts supplied by @frankkilcommins as a general-purpose docs publishing script with some amendments to place the content within docs/ rather than at the top-level of the repo.

The GitHub Action fires for changes to the docs directory on next and main (and temporarily tom/docs-as-code for the purposes of testing this PR).

@tomlongridge tomlongridge requested a review from a team as a code owner August 1, 2025 14:13
Copy link

github-actions bot commented Aug 1, 2025

🎯 Coverage Target Met!

📈 Coverage Metrics

Metric Coverage Target Status
Lines 96.8% 80%
Functions 90.5% 80%
Branches 95.9% 80%
Statements 96.8% 80%

📊 Test Statistics

  • Total Lines: 763 / 788
  • Total Functions: 19 / 21
  • Total Branches: 142 / 148

🔍 Files Needing Coverage

File Coverage
common/templates.ts 77.9%
insight-hub/client.ts 98.9%

📝 Report generated on Node.js 22 • View workflow • Coverage by Vitest + v8

Copy link
Contributor

@sazap10 sazap10 left a comment

Choose a reason for hiding this comment

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

generally seems ok, a few comments

branches:
- main
- next
- 'tom/docs-as-code'
Copy link
Contributor

Choose a reason for hiding this comment

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

i guess we can get rid of this now

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use node 20 here?

Comment on lines +38 to +42
- name: Install cspell
run: npm install -g cspell

- name: Run cspell
run: cspell --config ./.cspell.json "./docs/**/*.md"
Copy link
Contributor

Choose a reason for hiding this comment

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

could we combine this to run via npx?

Suggested change
- name: Install cspell
run: npm install -g cspell
- name: Run cspell
run: cspell --config ./.cspell.json "./docs/**/*.md"
- name: Run cspell
run: npx cspell --config ./.cspell.json "./docs/**/*.md"

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
Copy link
Contributor

Choose a reason for hiding this comment

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

can we run this on node 20?

# Further actions...
log_message $INFO "Validating manifest in product: $product_name"
log_message $DEBUG "Validating manifest: $manifest"
ajv validate -s ./docs/schemas/manifest.schema.json -d "$manifest" --spec=draft2020
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use npx here to avoid the install:

Suggested change
ajv validate -s ./docs/schemas/manifest.schema.json -d "$manifest" --spec=draft2020
npx ajv validate -s ./docs/schemas/manifest.schema.json -d "$manifest" --spec=draft2020

Copy link
Contributor

Choose a reason for hiding this comment

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

i assume we mean to use a draft2020 spec?

# - SWAGGERHUB_PORTAL_SUBDOMAIN: SwaggerHub Portal subdomain

# Source the utility script to use its functions
source ./docs/scripts/utilities.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

you should be able to use:

Suggested change
source ./docs/scripts/utilities.sh
source "$(dirname "${BASH_SOURCE[0]}")/utilities.sh"

@sazap10 sazap10 requested a review from Copilot August 1, 2025 14:26
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR establishes a docs-as-code workflow to keep developer.smartbear.com documentation in sync with the repository. The changes enable automatic publishing of markdown documentation from the docs/ directory to the live portal when changes are pushed to main or next branches.

  • Adds comprehensive documentation for the SmartBear MCP Server product
  • Creates publishing infrastructure with scripts to deploy content to SwaggerHub Portal
  • Implements GitHub Actions workflow for automated spell checking, validation, and publishing

Reviewed Changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/scripts/utilities.sh Utility functions for logging across different levels
docs/scripts/publish-portal-content.sh Main publishing script for deploying content to SwaggerHub Portal
docs/schemas/manifest.schema.json JSON schema for validating product manifest files
docs/products/SmartBear MCP Server/*.md Complete documentation for SmartBear MCP Server including setup, capabilities, and troubleshooting
docs/products/SmartBear MCP Server/manifest.json Product metadata and content structure definition
docs/custom-words.txt Custom dictionary for spell checking
.github/workflows/docs-as-code.yaml CI/CD workflow for validation and publishing
.cspell.json Spell checker configuration
Comments suppressed due to low confidence (6)

.github/workflows/docs-as-code.yaml:31

  • The checkout action version @v2 is outdated and deprecated. Consider updating to @v4 for better performance and security.
        uses: actions/checkout@v2

.github/workflows/docs-as-code.yaml:34

  • The setup-node action version @v2 is outdated and deprecated. Consider updating to @v4 for better performance and security.
        uses: actions/setup-node@v2

.github/workflows/docs-as-code.yaml:51

  • The checkout action version @v2 is outdated and deprecated. Consider updating to @v4 for better performance and security.
        uses: actions/checkout@v2

.github/workflows/docs-as-code.yaml:54

  • The setup-node action version @v2 is outdated and deprecated. Consider updating to @v4 for better performance and security.
        uses: actions/setup-node@v2

.github/workflows/docs-as-code.yaml:85

  • The checkout action version @v2 is outdated and deprecated. Consider updating to @v4 for better performance and security.
        uses: actions/checkout@v2

.github/workflows/docs-as-code.yaml:56

  • Node.js version 14 has reached end-of-life and is no longer supported. Consider updating to a supported version like 18 or 20.
          node-version: '14'

return
fi

local content_type=$(file --mime-type -b "$full_path")
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

The content_type is determined twice on consecutive lines (103 and 104). The second assignment on line 104 overwrites the first one, making line 103 redundant.

Copilot uses AI. Check for mistakes.

- Returns: Comprehensive error details including stack traces, occurrence patterns, affected users, and error metadata.
- Use case: Deep analysis of specific errors for debugging and resolution.

### `get_insight_hub_error_latest_event`
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

The function name get_insight_hub_error_latest_event is duplicated. Lines 23-29 and 30-36 both document the same function with identical descriptions and parameters.

Copilot uses AI. Check for mistakes.

branches:
- main
- next
- 'tom/docs-as-code'
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

The temporary branch 'tom/docs-as-code' should be removed from the trigger list once testing is complete to avoid unintended deployments.

Copilot uses AI. Check for mistakes.


steps:
- name: Checkout repository
uses: actions/checkout@v2
Copy link
Contributor

@sazap10 sazap10 Aug 1, 2025

Choose a reason for hiding this comment

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

we should update all these action versions to the latest and use pinned sha commit

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