Skip to content

Commit 11b9b36

Browse files
Merge pull request #41 from gleanwork/rwjblue/push-mymopxlpwpqn
feat!: Add code sample transformer for namespaced Python package
2 parents 5fea919 + 85f889a commit 11b9b36

10 files changed

Lines changed: 41450 additions & 23 deletions

File tree

.github/workflows/generate-code-samples.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ jobs:
3838
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
3939

4040
- name: Running code sample transformers
41+
run: pnpm transform:merged_code_samples_specs
42+
43+
- name: Copy specs into final_specs
4144
run: |
42-
cp -r ./merged_code_samples_specs/glean-client-merged-code-samples-spec.yaml ./final_specs/client_rest.yaml
43-
cp -r ./merged_code_samples_specs/glean-index-merged-code-samples-spec.yaml ./final_specs/indexing.yaml
45+
cp -r ./modified_code_samples_specs/client_rest.yaml ./final_specs/client_rest.yaml
46+
cp -r ./modified_code_samples_specs/indexing.yaml ./final_specs/indexing.yaml
4447
4548
- name: Commit changes
4649
uses: ./.github/actions/git-commit

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pnpm-lock.yaml
99
/generated_specs/
1010
/overlayed_specs/
1111
/merged_code_samples_specs/
12+
/modified_code_samples_specs/
1213
/final_specs/
1314

1415
# Speakeasy managed files

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ Preprocesses our OpenAPI specs to prepare them for generation via Speakeasy (our
66

77
This repository manages several types of OpenAPI specifications in different directories:
88

9-
| Directory | Purpose |
10-
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11-
| `source_specs/` | Original OpenAPI specification files provided as input to the transformation process. These are the source of truth for our API definitions. |
12-
| `generated_specs/` | Transformed OpenAPI specs with server URL subpaths moved to individual API paths. These files are consumed by Speakeasy to generate client libraries. |
13-
| `overlayed_specs/` | Specs with various overlays applied (see Overlays section below). The overlays add additional metadata or modifications needed for specific purposes. |
14-
| `merged_code_samples_specs/` | Specs with code samples merged from multiple sources. These enhanced specs provide examples for documentation and developer usage. |
15-
| `final_specs/` | Final, fully proccessed OpenAPI specifications that combine code samples from multiple sources that have been post-processed for correctness. These files are consumed by the gh-pages site and ultimately make their way to developers.glean.com. |
9+
| Directory | Purpose |
10+
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11+
| `source_specs/` | Original OpenAPI specification files provided as input to the transformation process. These are the source of truth for our API definitions. |
12+
| `generated_specs/` | Transformed OpenAPI specs with server URL subpaths moved to individual API paths. These files are consumed by Speakeasy to generate client libraries. |
13+
| `overlayed_specs/` | Specs with various overlays applied (see Overlays section below). The overlays add additional metadata or modifications needed for specific purposes. |
14+
| `merged_code_samples_specs/` | Specs with code samples merged from multiple sources. These enhanced specs provide examples for documentation and developer usage. |
15+
| `modified_code_samples_specs/` | Specs with code samples post processed (correcting issues with the generated code samples). |
16+
| `final_specs/` | Final, fully proccessed OpenAPI specifications that combine code samples from multiple sources that have been post-processed for correctness. These files are consumed by the gh-pages site and ultimately make their way to developers.glean.com. |
1617

1718
## Overlays
1819

@@ -47,6 +48,10 @@ The `overlayed_specs` directory contains merged OpenAPI specifications that comb
4748

4849
These merged specs are used for generating consistent client libraries across multiple APIs and provide a single source of documentation.
4950

51+
## Modified Code Samples Specs
52+
53+
This takes the specs from `merged_code_samples_specs` and runs `pnpm transform:merged_code_samples_specs` to correct issues with the generated code samples. This is done in the `.github/workflows/generate-code-samples.yml` GHA workflow.
54+
5055
## Final Specs
5156

5257
The `final_specs` directory contains the end product of all of the processing being done. These specs are copied into the published GitHub Pages site (in the `docs/specs/final` directory), and then used by [gleanwork/glean-developer-site](https://github.com/gleanwork/glean-developer-site).

0 commit comments

Comments
 (0)