-
Notifications
You must be signed in to change notification settings - Fork 1
[DEV-2435] Create New Package for SOAP API scripts #1536
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
base: main
Are you sure you want to change the base?
[DEV-2435] Create New Package for SOAP API scripts #1536
Conversation
🦋 Changeset detectedLatest commit: b1fdd0a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add changeset files
…soap-api-scripts' into DEV-2435-create-new-package-for-soap-api-scripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you have two changesets. "There can be only one!" (cit.)
|
This pull request is stale because it has been open for 14 days with no activity. If the pull request is still valid, please update it within 21 days to keep it open or merge it, otherwise it will be closed automatically. |
Co-authored-by: tommaso1 <tommasorosso1@gmail.com>
Co-authored-by: tommaso1 <tommasorosso1@gmail.com>
Co-authored-by: tommaso1 <tommasorosso1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe is better to add an example env file like packages/gitbook-docs/.env.default to show the necessary env var to run it locally
Done 👍 |
There was a problem hiding this 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 creates a new package soap-api-data to separate SOAP API-related functionality from the gitbook-docs package, following separation of concerns principles.
- Moves the
generateSoapApiRepositoriesListscript fromgitbook-docsto the newsoap-api-datapackage - Updates GitHub Actions workflow to use the new package location
- Creates proper package structure with TypeScript configuration and helper utilities
Reviewed Changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/soap-api-data/tsconfig.json | TypeScript configuration for the new package |
| packages/soap-api-data/src/helpers/fetchFromStrapi.ts | Helper utilities for fetching data from Strapi API |
| packages/soap-api-data/package.json | Package configuration with build scripts and dependencies |
| packages/soap-api-data/.eslintrc.json | ESLint configuration extending custom rules |
| packages/soap-api-data/.env.default | Default environment variables for the package |
| packages/gitbook-docs/package.json | Removes the moved script from gitbook-docs package |
| .github/actions/clone-soap-api-repos/action.yaml | Updates workflow to use new package location |
| .changeset/true-pandas-act.md | Changeset documenting the package changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // In case of an error, the error will be thrown | ||
| export async function fetchFromStrapi<T>( | ||
| url: string | ||
| ): Promise<{ data: T[]; responseJson?: any }> { |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type uses any for responseJson which reduces type safety. Consider defining a more specific interface for the Strapi response structure or using unknown if the structure is truly variable.
| ): Promise<{ data: T[]; responseJson?: any }> { | |
| ): Promise<{ data: T[]; responseJson?: unknown }> { |
| async function fetchFromStrapiResponse(url: string) { | ||
| console.log('Fetching from Strapi...'); | ||
| const strapiEndpoint = process.env.STRAPI_ENDPOINT; | ||
| const strapiApiToken = process.env.STRAPI_API_TOKEN; | ||
|
|
||
| if (!strapiEndpoint || !strapiApiToken) { | ||
| console.error('Missing Strapi configuration in environment variables'); | ||
| throw new Error('Missing Strapi configuration in environment variables'); |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is duplicated between the console.error and thrown Error. Consider extracting this to a constant to avoid duplication and improve maintainability.
| async function fetchFromStrapiResponse(url: string) { | |
| console.log('Fetching from Strapi...'); | |
| const strapiEndpoint = process.env.STRAPI_ENDPOINT; | |
| const strapiApiToken = process.env.STRAPI_API_TOKEN; | |
| if (!strapiEndpoint || !strapiApiToken) { | |
| console.error('Missing Strapi configuration in environment variables'); | |
| throw new Error('Missing Strapi configuration in environment variables'); | |
| const MISSING_STRAPI_CONFIG_ERROR = 'Missing Strapi configuration in environment variables'; | |
| async function fetchFromStrapiResponse(url: string) { | |
| console.log('Fetching from Strapi...'); | |
| const strapiEndpoint = process.env.STRAPI_ENDPOINT; | |
| const strapiApiToken = process.env.STRAPI_API_TOKEN; | |
| if (!strapiEndpoint || !strapiApiToken) { | |
| console.error(MISSING_STRAPI_CONFIG_ERROR); | |
| throw new Error(MISSING_STRAPI_CONFIG_ERROR); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Branch is not up to date with base branch@Sebastiano-Bertolin it seems this Pull Request is not updated with base branch. |
Jira Pull Request LinkThis Pull Request refers to the following Jira issue DEV-2435 |
|
This pull request is stale because it has been open for 14 days with no activity. If the pull request is still valid, please update it within 21 days to keep it open or merge it, otherwise it will be closed automatically. |
List of Changes
Move script generateSoapApiRepositoryList to a new package
Motivation and Context
Separation of concern
How Has This Been Tested?
Manually
Screenshots (if appropriate):
Types of changes
Checklist: