question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CI to push spec openapi document into OL website branch

See original GitHub issue

Problem

The current release.sh script defined in https://github.com/OpenLineage/OpenLineage/blob/main/spec/release.sh does the following:

# check if there are any changes in spec in the latest commit
if git diff --name-only --exit-code $PREV_SPEC_COMMIT HEAD 'spec/*.json' >> /dev/null; then
  echo "no changes in spec detected, skipping publishing spec"
  exit 0
fi

echo "Copying spec files from commit $PREV_SPEC_COMMIT"

# Mark last commit on which we finished copying spec
echo "$CIRCLE_SHA1" > "$WEBSITE_COMMIT_FILE"

# Copy changed spec fils to target location
git diff --name-only HEAD~1 HEAD 'spec/*.json' | while read LINE; do
  # extract target file name from $id field in spec files
  URL=$(cat $LINE | jq -r '.["$id"]')

  # extract target location in website repo
  LOC="${WEBSITE_DIR}/${URL#*//*/}"
  LOC_DIR="${LOC%/*}"

  # create dir if necessary, and copy files
  mkdir -p $LOC_DIR
  cp $LINE $LOC
done

So, basically it only adds whatever is ‘changed’ in the spec file, and then puts it into the website repo (so eventually it is available via website). However, it does NOT do the following:

  • Generate openapi.html (spec documentation)
  • pushes the updated openapi.html into the appropriate location in website.

Solution

  • Add the code to generate openapi.html (using redoc-cli)
  • pushes the updated openapi.html to the appropriate website location
  • Make sure all the files version are correct, as well as their json spec urls.

How to install and run redoc-cli

redoc-cli build --output ~/temp/openapi.html ./openlineage.yml

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rossturkcommented, Nov 15, 2022

The first half of this has now been done with #1295 #1296 #1298 #1299 and #1300.

The second half is being worked on in the website repo: https://github.com/OpenLineage/website/pull/70 - once that is merged successfully, we can close this issue.

1reaction
mobuchowskicommented, Nov 7, 2022

I think this should be done inside website CI, not in this repo CI. The parts that interact between different repos should be as small as possible, if we need to do a lot of cross-repo communication it might be better to just put the website into this monorepo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interactive API documentation - GitLab Docs
Introduces the interactive documentation tool for the GitLab API. About the OpenAPI specification. The OpenAPI specification (formerly called Swagger) defines a ...
Read more >
wshirey/openapi-ci-demo: Continuous Integration ... - GitHub
Run npm start · Make changes using your favorite editor or swagger-editor (look for URL in console output) ...
Read more >
How to validate the OpenAPI spec in CI Runners - Medium
The easy way to make perfect OpenAPI Spec by validating easily with the gkarthics/swagger-validate container image in CI.
Read more >
Getting started tutorial: Using Stoplight Studio to create an ...
Click Create. Stoplight Studio creates an OpenAPI (OAS) specification file called openweathermap.yml and loads it as follows: Open API editor in ...
Read more >
API Documentation with the OpenAPI Specification & Swagger ...
In this webinar, we will look at the role of the OpenAPI Specification in documenting APIs, and how teams can leverage tools like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found