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

Add a documentation page describing the different parts of the Openverse stack #3786

Merged
merged 16 commits into from
Feb 28, 2024

Conversation

zealshah29
Copy link
Contributor

@zealshah29 zealshah29 commented Feb 12, 2024

Fixes

Fixes #3201 by @AetherUnbound

Description

I have added a documentation page on the docs site that goes further in-depth about the various pieces of the stack, with references to the related documentation and code for each entity.

For each of the following sections of the stack listed, we have:

  • Link to the folder for the service on GitHub
  • Link to the documentation for the service on docs.openverse.org
  • Primary language(s) for the project
  • List of all of the tools/technologies/frameworks the services use along with links to each of its documentation

For example for the API, we have (respectively):

Testing Instructions

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@zealshah29 zealshah29 requested a review from a team as a code owner February 12, 2024 06:50
@openverse-bot openverse-bot added 🟩 priority: low Low priority and doesn't need to be rushed 🌟 goal: addition Addition of new feature 📄 aspect: text Concerns the textual material in the repository 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🏷 status: label work required Needs proper labelling before it can be worked on labels Feb 12, 2024
@obulat obulat removed the 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work label Feb 12, 2024
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zealshah29 this is a great start, thanks for the contributions. I do have some notes that I've elaborated on below.

  1. You need to lint the file so that the CI check for linting can pass. You can do so using the just lint recipe. Linting will also run automatically from then on as the lint recipe will download pre-commit and set up the Git hooks for you.

  2. The newly added stack.md file needs to be added to the table of contents, which present is in the file https://github.com/WordPress/openverse/blob/3e57bfaff03d44b97e73ef5794ef0eda40b33749/documentation/general/index.md.

  3. Automation is not technically a part of the stack as it's more concerned with general repository management. I would drop it but I'll defer to other maintainers for their views.

  4. The one-line descriptions for the stack layers can be found in the main README.md file, it'll be good to re-use those here.

  5. There are other components in our stack that are more general
    purpose and shared between these layers. These include

    • cache (Redis)
    • upstream and API database (PostgreSQL)
    • anaytics (third-party, Plausible)

    IMO these can, and should, be included in their own separate subsection.

- [Documentation](https://docs.openverse.org/api/index.html)
- Language: Python
- Tools and Framework:
- [Django REST Framework](https://www.django-rest-framework.org/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also include Django above this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall I add it to line number 25?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be great, thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhruvkb do you have an opinion about the docs links being pinned to a version? (5.0 in this case?) Not sure there's anything we can do about that 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need to make any changes related to the link over here?

- Language: Python
- Tools and Framework:
- [Elasticsearch](https://www.elastic.co/guide/index.html)
- [Docker](https://docs.docker.com/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker is basically a dev + deployment mechanism and not a part of the stack's technologies so I recommend dropping that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

- The public search engine at [openverse.org](https://openverse.org/), built with Vue and Nuxt.
- [Code](https://github.com/WordPress/openverse/blob/main/frontend)
- [Documentation](https://docs.openverse.org/frontend/index.html)
- Language: JavaScript, HTML, CSS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML and CSS are kind-of universal to frontend dev so we can skip them. Also TypeScript is more appropriate here.

Suggested change
- Language: JavaScript, HTML, CSS
- Language: TypeScript / Node.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Comment on lines 36 to 37
- [Node.js](https://nodejs.org/docs/latest/api/)
- [Tailwind CSS](https://v2.tailwindcss.com/docs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node.js is neither a tool nor a framework. It's a JS runtime, so it feels incorrect to list here.

As for TailwindCSS, it is a very small, not-noteworthy slice of the number of technologies we use in the frontend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Comment on lines 45 to 50






Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These blank lines should be removed as the lint job in CI will complain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@zealshah29
Copy link
Contributor Author

Hi, can you share the documentation for step-by-step guidance on how to lint the file?

  1. You need to lint the file so that the CI check for linting can pass. You can do so using the just lint recipe. Linting will also run automatically from then on as the lint recipe will download pre-commit and set up the Git hooks for you.

Shall I create a separate subsection for this? Or shall I add them under tools and framework for each stack? Also do we have a folder on the GitHub for the following files along with its documentation?

There are other components in our stack that are more general
purpose and shared between these layers. These include

  • cache (Redis)
  • upstream and API database (PostgreSQL)
  • anaytics (third-party, Plausible)
  • IMO these can, and should, be included in their own separate subsection.

@dhruvkb
Copy link
Member

dhruvkb commented Feb 13, 2024

Hi, can you share the documentation for step-by-step guidance on how to lint the file?

I search our docs and it turns out unfortunately, we do not have docs for that, which is a big miss on our end (and a potential opportunity for you to submit a PR for, once you've set it up for yourself).

Linting locally requires a bunch of tooling set up like just, Docker and Node.js. Would you be open to installing them? If so, please do so and then run just lint from the project root directory.

If you would like to not set them up, let us know and we'll lint the file for you.

Shall I create a separate subsection for this?

Yes, a separate section with a name like "External services" would be good to group these services.

Also do we have a folder on the GitHub for the following files along with its documentation?

All of our external services are in the https://github.com/WordPress/openverse/tree/b4b0cc939dec200efc3bf6db55b402c67ed678c7/docker directory.


Additionally, I missed some stacks like Documentation and some external services like Elasticsearch. Would be nice to include the documentation for them as well.

Thanks again for this contribution and for being conducive to my feedback.

@zealshah29
Copy link
Contributor Author

I search our docs and it turns out unfortunately, we do not have docs for that, which is a big miss on our end (and a potential opportunity for you to submit a PR for, once you've set it up for yourself).

Linting locally requires a bunch of tooling set up like just, Docker and Node.js. Would you be open to installing them? If so, please do so and then run just lint from the project root directory.

If you would like to not set them up, let us know and we'll lint the file for you.

Okay, I shall do the setup and try that on my own. In case I need help, I'll let you know.

Yes, a separate section with a name like "External services" would be good to group these services.

Okay

All of our external services are in the https://github.com/WordPress/openverse/tree/b4b0cc939dec200efc3bf6db55b402c67ed678c7/docker directory.

Additionally, I missed some stacks like Documentation and some external services like Elasticsearch. Would be nice to include the documentation for them as well.

Okay sure will go through it. So I'm planning to add them in the following manner:

External Services:

  • cache: Redis
  • upstream and API database: PostgreSQL
  • analytics: third-party, Plausible
  • ...
    The tools and frameworks used will be linked to their respective documentation. Would that be good?

Thanks again for this contribution and for being conducive to my feedback.

Thank you for your guidance and support.

@zealshah29
Copy link
Contributor Author

  1. Automation is not technically a part of the stack as it's more concerned with general repository management. I would drop it but I'll defer to other maintainers for their views.

Also, shall I remove Automations from stack.md?

@dhruvkb dhruvkb added 🧱 stack: documentation Related to Sphinx documentation and removed 🏷 status: label work required Needs proper labelling before it can be worked on labels Feb 15, 2024
@zealshah29
Copy link
Contributor Author

I search our docs and it turns out unfortunately, we do not have docs for that, which is a big miss on our end (and a potential opportunity for you to submit a PR for, once you've set it up for yourself).

Linting locally requires a bunch of tooling set up like just, Docker and Node.js. Would you be open to installing them? If so, please do so and then run just lint from the project root directory.

If you would like to not set them up, let us know and we'll lint the file for you.

Hi so I tried installing just, but I am facing the following issue:
image

Also, I checked the justfile and I read that it's not compatible with Windows OS. Since I am using windows OS (git bash), is there any way to do linting on my system?

@dhruvkb
Copy link
Member

dhruvkb commented Feb 18, 2024

@zealshah29 Openverse development is only supported for Linux or macOS, largely because none of the core maintainers have Windows. For Windows, we recommend WSL to get a Linux-like environment which is much more conducive for development.

However, in this case, we're happy to take over the PR and lint it ourselves.

@zealshah29
Copy link
Contributor Author

Hi, so I have updated the files as per the review.

Copy link
Collaborator

@stacimc stacimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zealshah29! Just a couple notes about the Catalog and ingestion server, and then we can get the linting fixed :)

documentation/general/stack.md Outdated Show resolved Hide resolved
documentation/general/stack.md Outdated Show resolved Hide resolved
documentation/general/stack.md Show resolved Hide resolved
- [Documentation](https://docs.openverse.org/api/index.html)
- Language: Python
- Tools and Framework:
- [Django REST Framework](https://www.django-rest-framework.org/)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhruvkb do you have an opinion about the docs links being pinned to a version? (5.0 in this case?) Not sure there's anything we can do about that 🤔

@zealshah29
Copy link
Contributor Author

Thank you @zealshah29! Just a couple notes about the Catalog and ingestion server, and then we can get the linting fixed :)

Yes sure, I shall make the necessary changes and share an update once it's done 👍🏻

zealshah29 and others added 2 commits February 26, 2024 23:57
Added PostgreSQL's documentation link.
@zealshah29
Copy link
Contributor Author

Thank you @zealshah29! Just a couple notes about the Catalog and ingestion server, and then we can get the linting fixed :)

Yes sure, I shall make the necessary changes and share an update once it's done 👍🏻

Hi, I have made the requested changes, could you please review it?

@stacimc
Copy link
Collaborator

stacimc commented Feb 26, 2024

Thanks for making those updates, @zealshah29! I think this is just about ready, but I've just noticed your PR is from your main branch. Could you please move your changes to a new feature branch and make a new PR from it, per the Openverse development guidelines? Let us know if you have any questions. Once that's done I'd be happy to push the linting changes for you and approve!

Copy link
Collaborator

@stacimc stacimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, since this PR has been open for awhile and has a good bit of context, I'll approve as is! Please use a feature branch in the future, however.

Thanks again for your contribution!

@zealshah29
Copy link
Contributor Author

On second thought, since this PR has been open for awhile and has a good bit of context, I'll approve as is! Please use a feature branch in the future, however.

Thanks again for your contribution!

Thank you! Sure I will take care of that from next time.

@openverse-bot
Copy link
Collaborator

Based on the low urgency of this PR, the following reviewers are being gently reminded to review this PR:

@dhruvkb
This reminder is being automatically generated due to the urgency configuration.

Excluding weekend1 days, this PR was ready for review 11 day(s) ago. PRs labelled with low urgency are expected to be reviewed within 5 weekday(s)2.

@zealshah29, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings.

Footnotes

  1. Specifically, Saturday and Sunday.

  2. For the purpose of these reminders we treat Monday - Friday as weekdays. Please note that the operation that generates these reminders runs at midnight UTC on Monday - Friday. This means that depending on your timezone, you may be pinged outside of the expected range.

@dhruvkb dhruvkb changed the title Added a documentation page describing the different parts of the Openverese stack. Add a documentation page describing the different parts of the Openverse stack Feb 28, 2024
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for linting @stacimc. I agree with your reasoning to merge it and open separate issues later.

@dhruvkb dhruvkb merged commit b873150 into WordPress:main Feb 28, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 aspect: text Concerns the textual material in the repository 🌟 goal: addition Addition of new feature 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: documentation Related to Sphinx documentation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add a documentation page describing the different parts of our stack
5 participants