Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

🔄 Synced file(s) with WordPress/openverse #1039

Merged
merged 6 commits into from
Dec 15, 2022
Merged
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
21 changes: 13 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,35 @@ title: "<Replace this with actual title>"
---

## Description

<!-- Concisely describe the bug. Compare your experience with what you expected to happen. -->
<!-- For example: "I clicked the 'submit' button and instead of seeing a thank you message, I saw a blank page." -->

## Reproduction

<!-- Provide detailed steps to reproduce the bug. -->

1. <!-- Step 1 ... -->
2. <!-- Step 2 ... -->
3. <!-- Step 3 ... -->
4. See error.

## Screenshots

<!-- Add screenshots to show the problem; or delete the section entirely. -->

## Environment

<!-- Please complete this, unless you are certain the problem is not environment specific. -->
- Device: <!-- (_eg._ iPhone Xs; laptop) -->
- OS: <!-- (_eg._ iOS 13.5; Fedora 32) -->
- Browser: <!-- (_eg._ Safari; Firefox) -->
- Version: <!-- (_eg._ 13; 73) -->
- Other info: <!-- (_eg._ display resolution, ease-of-access settings) -->

- Device: <!-- (_eg._ iPhone Xs; laptop) -->
- OS: <!-- (_eg._ iOS 13.5; Fedora 32) -->
- Browser: <!-- (_eg._ Safari; Firefox) -->
- Version: <!-- (_eg._ 13; 73) -->
- Other info: <!-- (_eg._ display resolution, ease-of-access settings) -->

## Additional context

<!-- Add any other context about the problem here; or delete the section entirely. -->

## Resolution
<!-- Replace the [ ] with [x] to check the box. -->
- [ ] 🙋 I would be interested in resolving this bug.
<!-- If you would like to work on this, please comment below separately. -->
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/discussion.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ title: "<Replace this with actual title>"
---

<!-- Consider how soon we need the discussion resolved vs. giving everyone an opportunity to participate. -->

## Due date: yyyy-mm-dd

<!-- Suggest two members of @WordPress/openverse to review the discussion. -->

## Assigned reviewers

- [ ] TBD
- [ ] TBD

<!-- Start the conversation. Please @ anyone relevant and try to ask questions to help facilate discussion. -->

## Description
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ title: "<Replace this with actual title>"
---

## Problem

<!-- Describe a problem solved by this feature; or delete the section entirely. -->

## Description

<!-- Describe the feature and how it solves the problem. -->

## Alternatives

<!-- Describe any alternative solutions or features you have considered. How is this feature better? -->

## Additional context

<!-- Add any other context about the feature here; or delete the section entirely. -->

## Implementation
<!-- Replace the [ ] with [x] to check the box. -->
- [ ] 🙋 I would be interested in implementing this feature.
<!-- If you would like to work on this, please comment below separately. -->
19 changes: 15 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
## Fixes

<!-- If PR doesn't fully resolve the issue, replace 'Fixes' below with 'Related to'. -->
<!-- If there is no issue being resolved, please consider opening one before creating this pull request. -->

Fixes #[issue number] by @[issue author]

## Description

<!-- Concisely describe what the pull request does. -->
<!-- Add screenshots, videos, or other media to show the problem and the solution when appropriate. -->

## Testing Instructions

<!-- Give steps for the reviewer to verify that this PR fixes the problem; or delete this section entirely. -->

## Checklist

<!-- Replace the [ ] with [x] to check the boxes. -->
- [ ] My pull request has a descriptive title (not a vague title like `Update index.md`).
- [ ] My pull request targets the *default* branch of the repository (`main`) or a parent feature branch.

- [ ] My pull request has a descriptive title (not a vague title like
`Update index.md`).
- [ ] My pull request targets the _default_ branch of the repository (`main`) or
a parent feature branch.
- [ ] My commit messages follow [best practices][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 tried running the project locally and verified that there are no visible
errors.

[best_practices]:https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines
[best_practices]:
https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines

## Developer Certificate of Origin

<!-- You must read and understand the following attestation. -->

<details>
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/pr_label_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check aspect label
uses: sugarshin/[email protected]
uses: docker://agilepathway/pull-request-label-checker:v1.2.9
with:
required_oneof: "💻 aspect: code,📄 aspect: text,🤖 aspect: dx,🕹 aspect: interface,♿️ aspect: a11y"
one_of: "💻 aspect: code,📄 aspect: text,🤖 aspect: dx,🕹 aspect: interface,♿️ aspect: a11y"
repo_token: ${{ secrets.GITHUB_TOKEN }}

check_goal_label:
name: Check goal label
runs-on: ubuntu-latest
steps:
- name: Check goal label
uses: sugarshin/[email protected]
uses: docker://agilepathway/pull-request-label-checker:v1.2.9
with:
required_oneof: "🌟 goal: addition,🛠 goal: fix,✨ goal: improvement,🧰 goal: internal improvement"
one_of: "🌟 goal: addition,🛠 goal: fix,✨ goal: improvement,🧰 goal: internal improvement"
repo_token: ${{ secrets.GITHUB_TOKEN }}

check_priority_label:
name: Check priority label
runs-on: ubuntu-latest
steps:
- name: Check priority label
uses: sugarshin/[email protected]
uses: docker://agilepathway/pull-request-label-checker:v1.2.9
with:
required_oneof: "🟩 priority: low,🟨 priority: medium,🟧 priority: high,🟥 priority: critical"
one_of: "🟩 priority: low,🟨 priority: medium,🟧 priority: high,🟥 priority: critical"
repo_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ repos:
rev: v2.6.0
hooks:
- id: prettier
exclude: \.md$ # TODO: https://github.com/WordPress/openverse/issues/333
additional_dependencies:
- [email protected]

Expand Down
28 changes: 21 additions & 7 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
This project comes under the WordPress [Etiquette](https://wordpress.org/about/etiquette/):
This project comes under the WordPress
[Etiquette](https://wordpress.org/about/etiquette/):

In the WordPress open source project, we realize that our biggest asset is the community that we foster. The project, as a whole, follows these basic philosophical principles from The Cathedral and The Bazaar.
In the WordPress open source project, we realize that our biggest asset is the
community that we foster. The project, as a whole, follows these basic
philosophical principles from The Cathedral and The Bazaar.

- Contributions to the WordPress open source project are for the benefit of the WordPress community as a whole, not specific businesses or individuals. All actions taken as a contributor should be made with the best interests of the community in mind.
- Participation in the WordPress open source project is open to all who wish to join, regardless of ability, skill, financial status, or any other criteria.
- The WordPress open source project is a volunteer-run community. Even in cases where contributors are sponsored by companies, that time is donated for the benefit of the entire open source community.
- Any member of the community can donate their time and contribute to the project in any form including design, code, documentation, community building, etc. For more information, go to make.wordpress.org.
- The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included, by keeping communication free of discrimination, incitement to violence, promotion of hate, and unwelcoming behavior.
- Contributions to the WordPress open source project are for the benefit of the
WordPress community as a whole, not specific businesses or individuals. All
actions taken as a contributor should be made with the best interests of the
community in mind.
- Participation in the WordPress open source project is open to all who wish to
join, regardless of ability, skill, financial status, or any other criteria.
- The WordPress open source project is a volunteer-run community. Even in cases
where contributors are sponsored by companies, that time is donated for the
benefit of the entire open source community.
- Any member of the community can donate their time and contribute to the
project in any form including design, code, documentation, community building,
etc. For more information, go to make.wordpress.org.
- The WordPress open source community cares about diversity. We strive to
maintain a welcoming environment where everyone can feel included, by keeping
communication free of discrimination, incitement to violence, promotion of
hate, and unwelcoming behavior.

The team involved will block any user who causes any breach in this.
52 changes: 38 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,60 @@
# Contributing to Openverse

Thank you for your interest in contributing to Openverse! This document is a set of guidelines to help you contribute to this project.
Thank you for your interest in contributing to Openverse! This document is a set
of guidelines to help you contribute to this project.

## Code of Conduct

By participating in this project, you are expected to uphold our [Code of Conduct](./CODE_OF_CONDUCT.md).
By participating in this project, you are expected to uphold our
[Code of Conduct](./CODE_OF_CONDUCT.md).

## Project Documentation

Please consult the [README](./README.md) file at the root of this repository.
Also see the [project documentation guidelines](./DOCUMENTATION_GUIDELINES.md) if you are interested in improving our documentation.
Also see the [project documentation guidelines](./DOCUMENTATION_GUIDELINES.md)
if you are interested in improving our documentation.

### Bugs

If you find a bug, please open an issue in this repository describing the bug. You can file a bug [here](https://github.com/WordPress/openverse-api/issues/new?template=bug_report.md). You will see a bug report template with the required information you should provide.
If you find a bug, please open an issue in this repository describing the bug.
You can file a bug
[here](https://github.com/WordPress/openverse-api/issues/new?template=bug_report.md).
You will see a bug report template with the required information you should
provide.

After that, don't forget to tag the issue with the "Bug" label.

### Proposing changes or new features

Feel free to [open an issue](https://github.com/WordPress/openverse-api/issues/new/choose) to discuss any new features or to propose any changes.
Feel free to
[open an issue](https://github.com/WordPress/openverse-api/issues/new/choose) to
discuss any new features or to propose any changes.

### Pull requests

Before you start writing code, make sure there is an issue open. Pull requests without a link to an existing issue won't be merged.
Before you start writing code, make sure there is an issue open. Pull requests
without a link to an existing issue won't be merged.

If you want to get started contributing code to this project but don't know exactly what to work on, we compiled a good list of issues labeled as [`good first issue`](https://github.com/wordpress/openverse-api/labels/good%20first%20issue) which are small in scope and not so complex to solve. There are also issues labeled as [`help wanted`](https://github.com/wordpress/openverse-api/labels/help%20wanted) which can be a bit more complex but are good examples of things we are currently accepting help from the community.
If you want to get started contributing code to this project but don't know
exactly what to work on, we compiled a good list of issues labeled as
[`good first issue`](https://github.com/wordpress/openverse-api/labels/good%20first%20issue)
which are small in scope and not so complex to solve. There are also issues
labeled as
[`help wanted`](https://github.com/wordpress/openverse-api/labels/help%20wanted)
which can be a bit more complex but are good examples of things we are currently
accepting help from the community.

Any code modifications will have to be accompanied by the appropriate unit tests. This will be checked and verified during code review. Once the Pull Request is opened, our CI server will run the unit test suite and run a code linter to verify that the code follows the coding guidelines.
Any code modifications will have to be accompanied by the appropriate unit
tests. This will be checked and verified during code review. Once the Pull
Request is opened, our CI server will run the unit test suite and run a code
linter to verify that the code follows the coding guidelines.

## Running the tests

### How to Run API live integration tests

You can check the health of a live deployment of the API by running the live integration tests.
You can check the health of a live deployment of the API by running the live
integration tests.

1. Change directory to `openverse_api`

Expand All @@ -47,11 +68,13 @@ cd openverse_api
pipenv install
```

Note: The following non-Python libraries or binaries are transient dependencies which will also need to be present on your computer for the project to run and install as expected:
Note: The following non-Python libraries or binaries are transient dependencies
which will also need to be present on your computer for the project to run and
install as expected:

* `librdkafka`
* `exempi`
* `audiowaveform`
- `librdkafka`
- `exempi`
- `audiowaveform`

3. Launch a new shell session

Expand Down Expand Up @@ -95,4 +118,5 @@ python3 test/integration_tests.py

## Questions or Thoughts?

Feel free to [join us on Slack](https://make.wordpress.org/chat/) and discuss the project with the engineers and community members on #openverse.
Feel free to [join us on Slack](https://make.wordpress.org/chat/) and discuss
the project with the engineers and community members on #openverse.
6 changes: 4 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# openverse-api contributors (sorted alphabetically by last name)

- **[Liza Daley](https://github.com/lizadaly)**
- Built CC Search prototype, bits of which live on in this repository to this day
- Built CC Search prototype, bits of which live on in this repository to this
day
- **[Alden Page](https://github.com/aldenstpage)**
- Author and maintainer of current implementation
- **[Paulo Rosário](https://github.com/paulofilip3)**
- Contributed to solution for consistent link rot filtering without impacting result count, improved test suite
- Contributed to solution for consistent link rot filtering without impacting
result count, improved test suite
- **[Krystle Salazar](https://github.com/krysal)**
- Implemented image takedown endpoint
- **[Habeeb Shopeju](https://github.com/HAKSOAT)**
Expand Down
26 changes: 18 additions & 8 deletions DOCUMENTATION_GUIDELINES.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# Documentation Guidelines

Interested in improving our documentation? Here’s what you need to know before making any changes to the documentation.
Interested in improving our documentation? Here’s what you need to know before
making any changes to the documentation.

<br/>

## Introduction

Openverse API uses [drf-yasg](https://github.com/axnsan12/drf-yasg), which is a tool that generates real Swagger/OpenAPI 2.0 specifications from a Django Rest Framework API.
Openverse API uses [drf-yasg](https://github.com/axnsan12/drf-yasg), which is a
tool that generates real Swagger/OpenAPI 2.0 specifications from a Django Rest
Framework API.

<br/>

## How to Start Contributing

- Run the server locally by following this [link](https://github.com/WordPress/openverse-api#running-the-server-locally)
- Run the server locally by following this
[link](https://github.com/WordPress/openverse-api#running-the-server-locally)
- Update documentation
- Make sure the updates passed the automated tests in this [file](https://github.com/WordPress/openverse-api/blob/main/.github/workflows/ci_cd.yml)
- Make sure the updates passed the automated tests in this
[file](https://github.com/WordPress/openverse-api/blob/main/.github/workflows/ci_cd.yml)
- Commit and push
- Create pull request by following [GitHub Repo Guidelines](https://opensource.creativecommons.org/contributing-code/github-repo-guidelines/)
- Create pull request by following
[GitHub Repo Guidelines](https://opensource.creativecommons.org/contributing-code/github-repo-guidelines/)

<br/>

Expand All @@ -30,7 +36,8 @@ Openverse API uses [drf-yasg](https://github.com/axnsan12/drf-yasg), which is a

## Cheat Sheet for drf-yasg

This is a quick syntax guide with examples on how to add or update the documentation for API endpoints.
This is a quick syntax guide with examples on how to add or update the
documentation for API endpoints.

<br/>

Expand Down Expand Up @@ -73,7 +80,9 @@ image_stats_description = \

### Responses

The response received after submitting an API request. The current API documentation includes response schemas and response samples based on their response codes.
The response received after submitting an API request. The current API
documentation includes response schemas and response samples based on their
response codes.

**Example**

Expand Down Expand Up @@ -159,7 +168,8 @@ register_api_oauth2_request = openapi.Schema(

### Code Examples

Code examples on how to use the API endpoints. The current API documentation provides code examples in Bash.
Code examples on how to use the API endpoints. The current API documentation
provides code examples in Bash.

**Example**

Expand Down
Loading