Skip to content

feat: add reverse sorting #32

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

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2796367
CFbot integration
JelteF Jan 12, 2025
8e33e1e
Integrate previous CFbot links with new code
JelteF Jan 12, 2025
6a96e78
Make CFbot add a history item when patch needs rebase
JelteF Jan 12, 2025
a9f9a19
Add a basic editorconfig file
JelteF Jan 12, 2025
df8c7a3
Add ID column to commitfest page
JelteF Jan 12, 2025
199bc75
Make sorting a toggle
JelteF Jan 13, 2025
057dad4
Allow sorting by name
JelteF Jan 13, 2025
7e10ee3
Allow sorting using the header of the closed patches too
JelteF Jan 13, 2025
d54c83a
Update readme with correct django version
JelteF Jan 13, 2025
013eeb1
Make /patch/{id} the URL for a patch
JelteF Jan 12, 2025
f660a47
Adjust direction of dropdowns at the bottom of the page (#4)
polkerty Jan 20, 2025
4e86587
Add dummy data for development (#5)
polkerty Jan 26, 2025
028f655
Do not display "scheduled" CFBot tasks as failed (#9)
JelteF Jan 31, 2025
9dfa825
Support local cfbot integration development with dummy data (#8)
JelteF Jan 31, 2025
57361ad
Implement cache busting for our own static files (#23)
JelteF Jan 31, 2025
bdc8643
Add patch stats (#22)
JelteF Jan 31, 2025
40c9e12
Fix cirrus CI urls on patch page
JelteF Feb 1, 2025
f93ddbb
Fix searching by Message-ID
JelteF Feb 1, 2025
96758a1
Implement github action to deploy to test environment
mhagander Feb 7, 2025
81fd380
Add experimental workflow for transferdb
mhagander Feb 7, 2025
d176d74
Default author to self when adding a new patch (#26)
JelteF Feb 8, 2025
fdd23d5
Fix problems reported by "ruff check" (#1)
JelteF Dec 10, 2024
18b7268
Add ruff Github action (#1)
JelteF Dec 10, 2024
b12457e
Add Makefile for linting and formatting (#1)
JelteF Dec 10, 2024
41f9554
Ignore W503, for pycodestyle (#1)
JelteF Dec 21, 2024
cbc7288
Use ruff in pre-commit hook (#1)
JelteF Dec 21, 2024
28a52fd
Don't mix tab and spaces indentation in pre-commit hook (#1)
JelteF Dec 21, 2024
47cce9b
Add ruff config (#1)
JelteF Dec 21, 2024
fb9c23f
Run "ruff format" to do initial formatting (#1)
JelteF Feb 10, 2025
207679e
Run "ruff check --fix" to sort imports (#1)
JelteF Feb 10, 2025
ac70e3d
Make deploy workflow run on prod branch as well
mhagander Feb 14, 2025
ec2033f
Add biome formatting for js and css (#29)
JelteF Feb 15, 2025
305d384
Format files using biome (#29)
JelteF Feb 15, 2025
3d63e9f
Fix biome lints using --fix --unsafe (#29)
JelteF Feb 15, 2025
d070301
Add codeformatting info to readme
JelteF Feb 15, 2025
4a32308
Add some more contributing info to the README
JelteF Feb 15, 2025
becd119
Fix link in README
JelteF Feb 15, 2025
9858f5f
README: Clarify that credentials are for HTTP auth
JelteF Feb 15, 2025
f1329ab
Autofill new patch description based on selected thread (#30)
JelteF Feb 15, 2025
59c1836
feature: added reverse sorting
destrex271 Feb 16, 2025
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
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# top-most EditorConfig file
root = true

# basic rules for all files
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[*.{py,js}]
indent_style = space
indent_size = 4

[*.html]
indent_style = space
indent_size = 1
29 changes: 29 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI
on:
push:
branches: ["master"]
pull_request:

jobs:
format:
runs-on: ubuntu-24.04
name: "Linting and formatting"
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run ruff check
uses: astral-sh/ruff-action@v2

- name: Run ruff format --check
uses: astral-sh/ruff-action@v2
with:
args: "format --check"

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Run Biome
run: biome ci .
16 changes: 16 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Deploy

on:
push:
branches:
- main
- prod

jobs:
deployment:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
steps:
- name: Trigger deploy
run: |
curl -fsS -X POST ${{ secrets.HOOKURL }} -H "X-Key: ${{ secrets.HOOKSECRET }}"
13 changes: 13 additions & 0 deletions .github/workflows/transferdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: TransferDB

# Manually triggered only
on: workflow_dispatch

jobs:
transferdb:
runs-on: ubuntu-latest
environment: admin
steps:
- name: Trigger db transfer
run: |
curl -fsS -X POST ${{ secrets.TRANSFER_URL }} -H "X-Key: ${{ secrets.TRANSFER_KEY }}"
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
format:
ruff format
npx @biomejs/biome format --write

lint:
ruff check
npx @biomejs/biome check

lint-fix:
ruff check --fix
npx @biomejs/biome check --fix
53 changes: 49 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ A commitfest is a collection of patches and reviews for a project and is part of

## The Application

This is a Django 3.2 application backed by PostgreSQL and running on Python 3.x.
This is a Django 4.2 application backed by PostgreSQL and running on Python 3.x.

## Getting Started

### Ubuntu instructions

#### Install Dependencies / Configure Environment

First, prepare your development environment by installing pip, virtualenv, and postgresql-server-dev-X.Y.

```bash
Expand Down Expand Up @@ -45,12 +47,24 @@ be provided.
./manage.py migrate
```

You'll need either a database dump of the actual server's data or else to create a superuser:
#### Load data
For a quick start, you can load some dummy data into the database. Here's how you do that:

```
./manage.py loaddata auth_data.json
./manage.py loaddata commitfest_data.json
```

If you do this, the admin username and password are `admin` and `admin`.

On the other hand, if you'd like to start from scratch instead, you can run the following command to create
a super user:

```bash
./manage.py createsuperuser
```

#### Start application
Finally, you're ready to start the application:

```bash
Expand All @@ -62,10 +76,41 @@ admin interface, go back to the main interface. You're now logged in.

## Contributing

Before committing make sure to install the git pre-commit hook to adhere to the
codestyle.
Code formatting and linting is done using [`ruff`] and [`biome`]. You can run
formatting using `make format`. Linting can be done using `make lint` and
automatic fixing of linting errors can be done using `make lint-fix`. CI checks
that you adhere to these coding standards.

You can install the git pre-commit hook to help you adhere to the codestyle:

```bash
ln -s ../../tools/githook/pre-commit .git/hooks/
```

[`ruff`]: https://docs.astral.sh/ruff/
[`biome`]: https://biomejs.dev/

### Discord

If you want to discuss development of a fix/feature over chat. Please join the
`#commitfest-dev` channel on the ["PostgreSQL Hacking" Discord server][1]

[1]: https://discord.gg/XZy2DXj7Wz

### Staging server

The staging server is available at: <https://commitfest-test.postgresql.org/>
User and password for the HTTP authentication popup are both `pgtest`. The
`main` branch is automatically deployed to the staging server. After some time
on the staging server, commits will be merged into the `prod` branch, which
automatically deploys to the production server.

### Regenerating the database dump files

If you'd like to regenerate the database dump files, you can run the following commands:
```
./manage.py dumpdata auth --format=json --indent=4 --exclude=auth.permission > pgcommitfest/commitfest/fixtures/auth_data.json
./manage.py dumpdata commitfest --format=json --indent=4 > pgcommitfest/commitfest/fixtures/commitfest_data.json
```

If you want to reload data from dump file, you can run `drop owned by postgres;` in the `pgcommitfest` database first.
36 changes: 36 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": true,
"ignore": [],
"include": [
"media/commitfest/js/commitfest.js",
"media/commitfest/css/commitfest.css",
"biome.json"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-r requirements.txt
uwsgi
pycodestyle
ruff
54 changes: 35 additions & 19 deletions media/commitfest/css/commitfest.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,45 @@

/* For close button with float disabled */
.close-nofloat {
float: none !important;
float: none !important;
}

/* General form styling */
.form-horizontal div.form-group {
margin-bottom: 10px;
margin-bottom: 10px;
}
div.form-group div.controls ul {
list-style-type: none;
margin: 0px;
padding: 0px;
list-style-type: none;
margin: 0px;
padding: 0px;
}
div.form-group div.controls ul li {
display: inline;
display: inline;
}
div.form-group div.controls ul li label {
display: inline;
font-weight: normal;
vertical-align:middle;
display: inline;
font-weight: normal;
vertical-align: middle;
}
div.form-group div.controls ul li label input {
display: inline;
vertical-align:middle;
display: inline;
vertical-align: middle;
}
div.form-group div.controls input[type='checkbox'] {
width: 10px;
div.form-group div.controls input[type="checkbox"] {
width: 10px;
}

div.form-group div.controls input.threadpick-input {
width: 80%;
display: inline;
width: 80%;
display: inline;
}



/*
* Attach thread dialog
*/
#attachThreadListWrap.loading {
display: block;
background: url('/media/commitfest/spinner.gif') no-repeat center;
background: url("/media/commitfest/spinner.gif") no-repeat center;
width: 124px;
height: 124px;
margin: 0 auto;
Expand All @@ -57,11 +55,29 @@ div.form-group div.controls input.threadpick-input {
* Annotate message dialog */
#annotateMessageBody.loading {
display: block;
background: url('/media/commitfest/spinner.gif') no-repeat center;
background: url("/media/commitfest/spinner.gif") no-repeat center;
width: 124px;
height: 124px;
margin: 0 auto;
}
#annotateMessageBody.loading * {
display: none;
}

.cfbot-summary img {
margin-top: -3px;
}

.github-logo {
height: 20px;
}

.additions {
font-weight: bold;
color: green;
}

.deletions {
font-weight: bold;
color: red;
}
1 change: 1 addition & 0 deletions media/commitfest/github-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading