Skip to content
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

MDXv2 compatible results #640

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
paths-ignore:
- '**.md'
- '**.md*'
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand Down Expand Up @@ -39,10 +39,10 @@ jobs:
- name: Download Result
uses: actions/download-artifact@v4
with:
name: results.md
name: results.mdx
- name: Build GH page
run: |
mv results.md docs/index.md
mv results.mdx docs/index.mdx
mkdocs build
- name: Upload GH page
uses: actions/upload-pages-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/comment-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
name: 'results.md'
name: 'results.mdx'
});
var compatibilityResult = resultArtifactInfo.data.artifacts.filter((artifact) => {
return artifact.name.startsWith("results") && artifact.name.endsWith(".md")
return artifact.name.startsWith("results") && artifact.name.endsWith(".mdx")
})[0];
var downloadedResultsArtifact = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ jobs:
npm run compatibility:report -- final_results.json
- name: Generate Job Summary
run: |
cat results.md
cat results.md >> $GITHUB_STEP_SUMMARY
cat results.mdx
cat results.mdx >> $GITHUB_STEP_SUMMARY
- name: Upload Results
uses: actions/upload-artifact@v4
with:
name: results.md
path: ./results.md
name: results.mdx
path: ./results.mdx
retention-days: 7

pr-info:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-hosted-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:
TEST_URL: ${{ secrets.URL_STEPZEN }}
- name: Generate Results Summary
run: |
cat results.md >> $GITHUB_STEP_SUMMARY
mv results.md results-${{ env.SUBGRAPH }}.md
echo "RESULTS_FILE=results-${{ env.SUBGRAPH }}.md" >> $GITHUB_ENV
cat results.mdx >> $GITHUB_STEP_SUMMARY
mv results.mdx results-${{ env.SUBGRAPH }}.mdx
echo "RESULTS_FILE=results-${{ env.SUBGRAPH }}.mdx" >> $GITHUB_ENV
- name: Upload Results
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-subgraph-grafbase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
# run: npm run compatibility:test -- docker --compose implementations/grafbase/docker-compose.yaml --schema implementations/_template_library_/products.graphql --format markdown
# - name: Generate Results Summary
# run: |
# cat results.md >> $GITHUB_STEP_SUMMARY
# echo "RESULTS_FILE=results.md" >> $GITHUB_ENV
# cat results.mdx >> $GITHUB_STEP_SUMMARY
# echo "RESULTS_FILE=results.mdx" >> $GITHUB_ENV
# - name: Upload Results
# uses: actions/upload-artifact@v4
# with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
jq -s '.[0] + .[1] + {tests: .[2]}' implementations/${{ inputs.library }}/github_metadata.json implementations/${{ inputs.library }}/metadata.json results.json > results-${{ inputs.library }}.json
echo "RESULTS_FILE=results-${{ inputs.library }}.json" >> $GITHUB_ENV
else
cat results.md >> $GITHUB_STEP_SUMMARY
mv results.md results-${{ inputs.library }}.md
echo "RESULTS_FILE=results-${{ inputs.library }}.md" >> $GITHUB_ENV
cat results.mdx >> $GITHUB_STEP_SUMMARY
mv results.mdx results-${{ inputs.library }}.mdx
echo "RESULTS_FILE=results-${{ inputs.library }}.mdx" >> $GITHUB_ENV
fi
- name: Upload Results
uses: actions/upload-artifact@v4
Expand Down
5 changes: 3 additions & 2 deletions SUBGRAPH_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ implement to be used in the testing suite:
need to make additional edits to the `docker-compose.yml` file, your edits
should only affect the `products` service defined.
4. Test only your library by running `make setup` and `make test subgraph={YOUR_IMPLEMENTATION_FOLDER_NAME}`
and the results will be outputted to `results.md`
and the results will be outputted to `results.mdx`
5. Copy the `.github/workflows/templates/test-subgraph-library.yaml.template` and rename
it to include the name of your library under `.github/workflows/test-subgraph-<library>.yaml`
- This is a workflow that will be triggered for PRs opened against your implementation.
Expand Down Expand Up @@ -71,7 +71,7 @@ compatibility tests will fail.**
that will be tested. Calls should be authenticated with basic `x-api-key` header.
- You can modify the `proxy.conf.template` to specify different authentication header.
4. Test only your library by running `make setup` and `make test subgraph={YOUR_IMPLEMENTATION_FOLDER_NAME}`
and the results will be outputted to `results.md`. Since NGINX proxy will
and the results will be outputted to `results.mdx`. Since NGINX proxy will
require API KEY and URL, you will need to set it as environment variable prior
running tests.

Expand All @@ -97,6 +97,7 @@ compatibility tests will fail.**
API_KEY: ${{ secrets.API_KEY_<HOSTED> }}
TEST_URL: ${{ secrets.URL_<HOSTED> }}
```

7. When you are ready to integrate, reach out to us at [Apollo Community Forums](https://community.apollographql.com/).
Send a DM to any member of the [Ecosystem Group](https://community.apollographql.com/g/Ecosystem)
and we'll help you configure your API KEY and URL as a Github Secret. Those secrets will be used
Expand Down
2 changes: 1 addition & 1 deletion implementations/hotchocolate/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ node_modules/
# Intellij Configuration Files
.idea/

results.md
results.mdx
supergraph.graphql

## Java/SpringBoot gitignore
Expand Down
2 changes: 1 addition & 1 deletion packages/compatibility/src/compatibilityTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function compatibilityTest(
logWithTimestamp('generating results...');

if (runtimeConfig.format == 'markdown') {
generateSimplifiedMarkdown(testResults, `results.md`);
generateSimplifiedMarkdown(testResults, `results.mdx`);
} else {
await writeFile(
`results.json`,
Expand Down
14 changes: 8 additions & 6 deletions packages/compatibility/src/utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The following open-source GraphQL server libraries and other solutions support a
<tbody>
{{#implementations}}
<tr>
<th colspan="3"><big><a href="{{{documentation}}}">{{name}}</a></big></th>
<th colSpan="3"><big><a href="{{{documentation}}}">{{name}}</a></big></th>
</tr>
<tr>
<td>{{description}}<br/>
Expand Down Expand Up @@ -79,9 +79,11 @@ const singleImplementationTemplate = `
{{#compatibilities}}
<td>
<table>
{{#tests}}
<tr><th><code>{{name}}</code></th><td>{{result}}</td></tr>
{{/tests}}
<tbody>
{{#tests}}
<tr><th><code>{{name}}</code></th><td>{{result}}</td></tr>
{{/tests}}
</tbody>
</table>
</td>
{{/compatibilities}}
Expand All @@ -91,7 +93,7 @@ const singleImplementationTemplate = `
`;

const apolloIcon: string =
'<img style="display:inline-block; height:1em; width:auto;" alt="Maintained by Apollo" src="https://raw.githubusercontent.com/apollographql/apollo-federation-subgraph-compatibility/d7829ef89441c337749bf6538711a642cfa2689c/docs/assets/horizon_logo.png"/>';
"<img style={{ display: 'inline-block', height: '1em', width: 'auto' }} alt='Maintained by Apollo' src='https://raw.githubusercontent.com/apollographql/apollo-federation-subgraph-compatibility/d7829ef89441c337749bf6538711a642cfa2689c/docs/assets/horizon_logo.png'/>";
const apolloName: string = 'apollographql';

interface CompatibilityResults {
Expand Down Expand Up @@ -220,7 +222,7 @@ export function generateMarkdown(results: TestResultDetails[]) {
apolloIcon: apolloIcon,
});

writeFileSync(resolve(process.cwd(), 'results.md'), output, 'utf-8');
writeFileSync(resolve(process.cwd(), 'results.mdx'), output, 'utf-8');
}

export function generateSimplifiedMarkdown(
Expand Down
Loading