Skip to content

chore: refine HTTP checks and schedule for generate-readme - #9909

Draft
quirogas wants to merge 1 commit into
googleapis:mainfrom
quirogas:chore/readme-generator-http-checks
Draft

quirogas wants to merge 1 commit into
googleapis:mainfrom
quirogas:chore/readme-generator-http-checks

Conversation

@quirogas

Copy link
Copy Markdown
Contributor

Description

Updates HTTP client checks in generate-readme.mjs and workflow schedule settings.

Impact

Fixes support URL fallback checks and reduces scheduled workflow runs.

Changes

  • Use a dedicated Gaxios client with retry configuration for registry.npmjs.org package lookups in bin/generate-readme.mjs.
  • Check res.status === 404 when probing supportDocsUrl with validateStatus: () => true so missing Getting Support pages fall back to product_documentation.
  • Replace the unexpanded {{ metadata['lib_install_cmd'] }} placeholder in bin/README.mustache and regenerate README.md.
  • Add name, concurrency, timeout-minutes: 15, and a weekly cron schedule to .github/workflows/update-api-list.yaml.

Testing

  • Verified ESM syntax with node --check bin/generate-readme.mjs.
  • Validated .github/workflows/update-api-list.yaml YAML syntax.

Alternatives

  • Keeping daily runs and leaving validateStatus: () => true without checking res.status runs unnecessary daily jobs and skips the support link fallback on 404 responses.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the legacy installation instructions in the README files to use a static npm command instead of a template variable. Additionally, it introduces a dedicated npmRegistry Gaxios instance for querying npm and refactors the HTTP status handling in bin/generate-readme.mjs. Feedback on the changes notes that because validateStatus: () => true is configured, HTTP errors like 404 will not be thrown, rendering the 404 checks inside the catch block unreachable dead code that can be simplified.

Comment thread bin/generate-readme.mjs Resolved

This branch has not been deployed

No deployments
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.

1 participant