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

chore: Reference Github code in Docusaurus #18229

Merged
merged 5 commits into from
Feb 2, 2022
Merged

chore: Reference Github code in Docusaurus #18229

merged 5 commits into from
Feb 2, 2022

Conversation

geido
Copy link
Member

@geido geido commented Jan 31, 2022

SUMMARY

This is a POC for referencing Github code in Docusaurus.

AFTER

POC.Github.code.ref._.Superset.mp4

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@ad-m
Copy link
Contributor

ad-m commented Jan 31, 2022

I like the direction, but I am afraid about the maintenance of that solution in long term. We have a hard-coded commit ID (or git tag) and a hard-coded line number. This can be easily outdated:

  • the example will be updated and the commit IT will not be updated to point to the new code,
  • the reference will be updated with the new code, but the lines will not be changed, e.g. extended with an additional enter added.

As for the first case, we may use the version identifier (git tag) instead of commit in the future. However, then the second case is then even more likely.

To reduce this case scenario Apache Airflow uses comments in the referenced file ( https://github.com/apache/airflow/blob/main/docs/apache-airflow/tutorial_taskflow_api.rst ), predicable comment structure (tags eg. for examples is added before this is required in the documentation). It allows also check that references on CI.

@geido
Copy link
Member Author

geido commented Jan 31, 2022

I like the direction, but I am afraid about the maintenance of that solution in long term. We have a hard-coded commit ID (or git tag) and a hard-coded line number. This can be easily outdated:

  • the example will be updated and the commit IT will not be updated to point to the new code,
  • the reference will be updated with the new code, but the lines will not be changed, e.g. extended with an additional enter added.

As for the first case, we may use the version identifier (git tag) instead of commit in the future. However, then the second case is then even more likely.

To reduce this case scenario Apache Airflow uses comments in the referenced file ( https://github.com/apache/airflow/blob/main/docs/apache-airflow/tutorial_taskflow_api.rst ), predicable comment structure (tags eg. for examples is added before this is required in the documentation). It allows also check that references on CI.

Hey @ad-m you are perfectly right and we also share these concerns. However, for the time being, we are happy with this solution as the code references that we are looking to add do not change very often. We definitely would like to think of longer-term solutions and the Airflow solution seems well structured. I am pinging @villebro who also has some ideas on this topic.

@geido geido removed the Flexiana label Jan 31, 2022
@geido geido changed the title chore: POC for referencing Github code in Docusaurus chore: Reference Github code in Docusaurus Jan 31, 2022
@geido
Copy link
Member Author

geido commented Jan 31, 2022

As the POC was successful I am removing the POC file and moving this PR to mergeable

@geido geido marked this pull request as ready for review January 31, 2022 15:33
@geido geido merged commit ad4d05c into apache:master Feb 2, 2022
shcoderAlex pushed a commit to casual-precision/superset that referenced this pull request Feb 7, 2022
* POC github code reference

* Add example

* Remove unnecessary change

* Remove POC page
ofekisr pushed a commit to nielsen-oss/superset that referenced this pull request Feb 8, 2022
* POC github code reference

* Add example

* Remove unnecessary change

* Remove POC page
bwang221 pushed a commit to casual-precision/superset that referenced this pull request Feb 10, 2022
* POC github code reference

* Add example

* Remove unnecessary change

* Remove POC page
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants