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

Ci #132

Merged
merged 12 commits into from
Nov 14, 2023
Merged

Ci #132

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
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
use nix -p bacon just yq postgresql_15 redis
export RUST_LOG=info,difft=off,poem_ext,lib,entity,migration,challenges=trace
on_git_branch latest && exit
use flake .#$(cat .devshell 2> /dev/null)
dotenv_if_exists
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Description
<!-- Please provide a summary of the change and include relevant motivation and context. -->

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

<!-- Replace ISSUE-NUMBER with the id of the ticket this PR is supposed to solve -->
Fixes Bootstrap-Academy/Bootstrap-Academy#ISSUE-NUMBER

<!-- To receive a reward for contributing, enter the username of your Bootstrap Academy account -->
My Bootstrap Academy username:
23 changes: 0 additions & 23 deletions .github/workflows/notify-release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/.direnv
/.env
/.devshell
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Bootstrap Academy contributing guide
Thank you for investing your time in contributing to this project! Any contribution you make will be reflected on https://bootstrap.academy/.

In this guide you will get an overview of the contribution workflow from opening a ticket, creating a pull request, reviewing, and merging the pull request.

## Tickets
All tickets are stored as GitHub issues in the [Bootstrap-Academy](https://github.com/Bootstrap-Academy/Bootstrap-Academy/issues) repository. Additionally, there is a [GitHub project](https://github.com/orgs/Bootstrap-Academy/projects/4) to provide a better overview over the currently active tickets.

For each ticket there is also a bounty in Bootstrap Academy Morphcoins which is given to the person who solves the ticket.

### Creating tickets
Before creating a new ticket, please make sure to search if an issue already exists to avoid duplicates.

On the ["New issue" page](https://github.com/Bootstrap-Academy/Bootstrap-Academy/issues/new/choose) please choose an appropriate template and fill it out as accurately as possible. If there is no template which matches the kind of ticket you would like to create, you can just [open a blank issue](https://github.com/Bootstrap-Academy/Bootstrap-Academy/issues/new).

Depending on the severity of the issue you report, you can also receive Morphcoins in the Bootstrap Academy as a reward, so make sure to include your Bootstrap Academy username in your ticket.

After creating your ticket, it is automatically added to the GitHub project and its status is set to "Triage/Draft". We will now review your ticket and maybe ask for some more details. After that, you will receive some Morphcoins as a reward (if you included your Bootstrap Academy username in the ticket) and the ticket status is set to "Todo".

### Solving tickets
To find a ticket to solve, you can have a look at the [GitHub project](https://github.com/orgs/Bootstrap-Academy/projects/4). Once you find an interesting ticket with the "Todo" status, you can just start working on it.

If you chose a more complicated ticket, you can also ask us to assign you to this ticket, so that others can see that this ticket is currently being worked on. But please only do this if you really have the time to solve the ticket (or parts of it) in the near future.

If you have any questions regarding the ticket or need help, don't hesitate to ask!

## Pull Requests
All code contributions are submitted through pull requests (aka PRs).

### Creating Pull Requests
When starting to work on a ticket, you can already create an (at first empty) draft pull request and regularly push your local changes. This allows others to test intermediate versions of your contribution and provide feedback.

In the pull request description don't forget to enter the id of the ticket you are working on as well as your Bootstrap Academy username (if you would like to receive the bounty).

Also make sure to [allow maintainer edits](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) in your pull request so the branch can be updated for a merge.

Once you are done solving the ticket and are sure that everything works as described in the ticket, you can mark the pull request as ready for review.

### Reviewing Pull Requests
Everyone can also contribute by reviewing and testing other people's pull requests and by providing feedback or suggesting changes. Note that the focus here should be on pull requests that are marked as ready for review and are not in the draft state anymore. Draft pull requests are still being worked on and are not expected to be complete yet, but for larger tickets intermediate reviews can also be helpful.

After your pull request has been approved, it is merged, the corresponding ticket is closed and you will receive the ticket bounty (if you included your Bootstrap Academy username in the pull request description).
13 changes: 0 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ members = [
"entity",
"lib",
"schemas",
"client",
"challenges",
]

[profile.release]
strip = true
lto = true
codegen-units = 1

[workspace.dependencies]
anyhow = { version = "1.0.75", default-features = false, features = ["std"] }
chrono = { version = "0.4.31", default-features = false, features = ["serde"] }
Expand Down
45 changes: 45 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Business Source License 1.1 Modified

**License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.**
“Business Source License” is a trademark of MariaDB Corporation Ab.

## Parameters

- **Licensor:**
Cedric Mössner

- **Licensed Work:**
The Licensed Work is (c) 2023 Cedric Mössner.

For more guidance on using Bootstrap Academy products under the Business Source License, please refer to our FAQ.
For information about alternative licensing arrangements for the Licensed Work, please contact [Cedric Mössner](mailto:[email protected]).

## Notice

### Terms

The Licensor hereby grants you the right to copy, modify, create derivative works, and make non-production use of the Licensed Work. Redistribution or distribution of the Licensed Work or any derivative works is strictly prohibited.

If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must contact the Licensor for a commercial license or refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License.

You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License.

This License does not grant you any right in any trademark or logo of Licensor.

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.

### Limitation of Liability

TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM, OUT OF, OR IN CONNECTION WITH THE LICENSED WORK OR THE USE OF THE LICENSED WORK, WHETHER BASED ON CONTRACT, TORT, OR OTHERWISE.

### Indemnification

You agree to indemnify, defend, and hold harmless the Licensor from and against any and all claims, liabilities, damages, losses, costs, expenses, or fees (including reasonable attorneys' fees) that arise from or relate to your use or misuse of the Licensed Work. The Licensor reserves the right to assume the exclusive defense and control of any matter otherwise subject to indemnification by you and, in such case, you agree to cooperate with the Licensor's defense of such claim.

### Governing Law and Jurisdiction

This License shall be governed by and construed in accordance with the laws of Germany, without regard to its conflict of laws principles. Any legal action or proceeding relating to this License shall be brought exclusively in the courts of Karlsruhe, Germany, and you hereby consent to the jurisdiction and venue of such courts.
46 changes: 38 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
[![check](https://github.com/Bootstrap-Academy/backend/actions/workflows/check.yml/badge.svg)](https://github.com/Bootstrap-Academy/backend/actions/workflows/check.yml)
[![test](https://github.com/Bootstrap-Academy/backend/actions/workflows/test.yml/badge.svg)](https://github.com/Bootstrap-Academy/backend/actions/workflows/test.yml)
[![docker](https://github.com/Bootstrap-Academy/backend/actions/workflows/docker.yml/badge.svg)](https://github.com/Bootstrap-Academy/backend/actions/workflows/docker.yml) <!--
https://app.codecov.io/gh/Bootstrap-Academy/backend/settings/badge
[![codecov](https://codecov.io/gh/Bootstrap-Academy/backend/branch/develop/graph/badge.svg?token=changeme)](https://codecov.io/gh/Bootstrap-Academy/backend) -->
<!-- ![Version](https://img.shields.io/github/v/tag/Bootstrap-Academy/backend?include_prereleases&label=version) -->
<!-- [![dependency status](https://deps.rs/repo/github/Bootstrap-Academy/backend/status.svg)](https://deps.rs/repo/github/Bootstrap-Academy/backend) -->
[![check](https://github.com/Bootstrap-Academy/challenges-ms/actions/workflows/check.yml/badge.svg)](https://github.com/Bootstrap-Academy/challenges-ms/actions/workflows/check.yml)
[![test](https://github.com/Bootstrap-Academy/challenges-ms/actions/workflows/test.yml/badge.svg)](https://github.com/Bootstrap-Academy/challenges-ms/actions/workflows/test.yml)
[![docker](https://github.com/Bootstrap-Academy/challenges-ms/actions/workflows/docker.yml/badge.svg)](https://github.com/Bootstrap-Academy/challenges-ms/actions/workflows/docker.yml) <!--
https://app.codecov.io/gh/Bootstrap-Academy/challenges-ms/settings/badge
[![codecov](https://codecov.io/gh/Bootstrap-Academy/challenges-ms/branch/develop/graph/badge.svg?token=changeme)](https://codecov.io/gh/Bootstrap-Academy/challenges-ms) -->
<!-- ![Version](https://img.shields.io/github/v/tag/Bootstrap-Academy/challenges-ms?include_prereleases&label=version) -->
<!-- [![dependency status](https://deps.rs/repo/github/Bootstrap-Academy/challenges-ms/status.svg)](https://deps.rs/repo/github/Bootstrap-Academy/challenges-ms) -->

# Bootstrap Academy Backend
# Bootstrap Academy Challenges Microservice
The official challenges microservice of [Bootstrap Academy](https://bootstrap.academy/).

If you would like to submit a bug report or feature request, or are looking for general information about the project or the publicly available instances, please refer to the [Bootstrap-Academy repository](https://github.com/Bootstrap-Academy/Bootstrap-Academy).

## Development Setup
1. Install the [Rust](https://www.rust-lang.org/) stable toolchain and [just](https://github.com/casey/just).
2. Clone this repository and `cd` into it.
3. Start a [PostgreSQL](https://www.postgresql.org/) database, for example using [Docker](https://www.docker.com/) or [Podman](https://podman.io/):
```bash
podman run -d --rm \
--name postgres \
-p 127.0.0.1:5432:5432 \
-e POSTGRES_HOST_AUTH_METHOD=trust \
postgres:alpine
```
4. Create the `academy-challenges` database:
```bash
podman exec postgres \
psql -U postgres \
-c 'create database "academy-challenges"'
```
5. Start a [Redis](https://redis.io/) instance, for example using [Docker](https://www.docker.com/) or [Podman](https://podman.io/):
```bash
podman run -d --rm \
--name redis \
-p 127.0.0.1:6379:6379 \
redis:alpine
```
6. Run `just migrate` to run the database migrations.
7. Run `just run` to start the microservice. You can find the automatically generated swagger documentation on http://localhost:8005/docs.
14 changes: 0 additions & 14 deletions client/Cargo.toml

This file was deleted.

Loading
Loading