Skip to content

Commit cc6fc71

Browse files
authored
Merge branch 'swatantrya' into remove-templates
2 parents cc37930 + ef16399 commit cc6fc71

File tree

31 files changed

+1414
-1058
lines changed

31 files changed

+1414
-1058
lines changed

devel/ansible/roles/local/tasks/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
- name: Install RPM packages
2+
become: true
3+
dnf:
4+
name:
5+
- poetry
6+
- gcc
7+
- libffi-devel
8+
- python3.13
9+
- libpq-devel
10+
- python3.13-devel
11+
- npm
12+
- supervisor
13+
state: present
14+
install_weak_deps: false
15+
16+
- name: Set Poetry to use Python 3.13
17+
command: poetry env use python3.13
18+
119
- name: Install the backend
220
command: poetry install --all-extras
321
register: result

frontend/public/docs/addendum.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Fedora Badges
2+
3+
[Fedora Badges](https://badges.fedoraproject.org) is a fun website built to recognize contributors to the [Fedora Project](https://fedoraproject.org), help new and existing Fedora contributors find different ways to get involved, and encourage the improvement of Fedora's infrastructure.
4+
5+
![Fedora Badges](https://badges.fedoraproject.org/pngs/badges_fan.png)
6+
7+
## How does Badges work?
8+
9+
It's really easy! Just [sign in to Badges](https://badges.fedoraproject.org/oidc/login) with your [Fedora account](https://accounts.fedoraproject.org/), and you'll see you have at least one badge right away. Congratulations - you're a Badger! If you participate in Fedora in any way, you'll probably notice Badges popping up on your profile as you go about your business, though sadly we don't cover every area of Fedora yet - we're doing our best to make sure we reward as many forms of participation as we can!
10+
11+
Want to see how your badge collection compares with others? Check the [Leaderboard](https://badges.fedoraproject.org/leaderboard). Jonesing for more badges? You can check the [Badge index](https://badges.fedoraproject.org/explore/badges) to see all the badges and get to work on your collection! Click on a badge to see how to get it - but we intentionally didn't spell it all out exactly. Part of the fun is figuring it out!
12+
13+
Another cool thing: the Badges site is mobile-optimized, so you can easily keep track of your badges on the go!
14+
15+
## Why don't I have all the Badges I should?
16+
17+
There are a few reasons why unfortunately you might not get some badges you would expect to receive. First of all, the infrastructure that underlies Badges has only been running since late 2012 (and some pieces since early 2013), and so for many Badges, we can't take contributions from before those dates into account. We're really sorry. We wish we could. We've filed a ticket requesting someone build us a time machine; logically speaking, though, if it was going to be closed, [it would've been closed immediately](http://boardgamegeek.com/boardgame/2297/us-patent-number-1)...
18+
19+
Secondly, in the case of some badges, you need to perform one action after signing up for Badges, to sort of 'prime the pump' (this is not really how it works. No pumps are involved. We've checked.) The [Curious Penguin (Ask Fedora II)](https://badges.fedoraproject.org/badge/curious-penguin-ask-fedora-ii) Badge, for instance, requires you to ask or answer ten questions at [Ask Fedora](https://ask.fedoraproject.org). When you first join Badges, even if you've already done this, you won't see the badge - but as soon as you ask or answer just one more question, you'll get it.
20+
21+
A special case of this problem affects Badges awarded for things you did before joining Badges, which you can't really do again - for instance, the [Proven Packager badge](https://badges.fedoraproject.org/badge/proven-packager), which is awarded when you join that group. We run a script to check for and award most of these badges regularly, so just sit back and be a patient Badger and you'll see them soon!
22+
23+
## Who made it?
24+
25+
Lots of people have contributed to the [frontend](https://github.com/fedora-infra/tahrir/graphs/contributors) and the [backend](https://github.com/fedora-infra/fedbadges/graphs/contributors). Various people have also [contributed Badge ideas, art and definitions](https://pagure.io/Fedora-Badges/commits/master). We hang out in `#fedora-apps` on freenode, we have a [mailing list](https://lists.fedoraproject.org/mailman/listinfo/badges), and a [wiki SIG page](https://fedoraproject.org/wiki/Open_Badges).
26+
27+
## Can I submit new badge ideas and help build badges?
28+
29+
Yes! We'd love you to! Just head over to the [new badge tracker](https://pagure.io/Fedora-Badges), or see the [wiki page](https://fedoraproject.org/wiki/Open_Badges#Getting_Involved) for more information.
30+
31+
## Can I help work on the technologies that underlie Badges?
32+
33+
Absolutely! Please join us! Starting at the bottom of the stack:
34+
35+
- [fedmsg](https://github.com/fedora-infra/fedora-messaging) is the Fedora message bus that most badges ultimately rely on
36+
- [datanommer](https://apps.fedoraproject.org/datagrepper) pulls every fedmsg message into a database
37+
- [fedbadges](https://github.com/fedora-infra/fedbadges) is the actual badge awarder
38+
- [tahrir](https://github.com/fedora-infra/tahrir) is the frontend you're looking at right now
39+
- [tahrir-api](https://github.com/fedora-infra/tahrir-api) is the API for tahrir
40+
41+
# Technical Questions and Details
42+
43+
## Once more, with feeling: How does Badges work?
44+
45+
If you mean how does it WORK work, it's pretty cool! Fedora Badges takes advantage of [fedmsg](https://github.com/fedora-infra/fedora-messaging) (Fedora Infrastructure's Message Bus) and [datanommer](https://apps.fedoraproject.org/datagrepper) to determine what kinds of contributions a person is making.
46+
47+
The badge awarding backend daemon, [fedbadges](https://github.com/fedora-infra/fedbadges), wakes up when it receives a fedmsg event. It compares that message and the history in datanommer against a series of [rules](https://pagure.io/Fedora-Badges/blob/master/f/rules). If a contributor matches the criteria described in one of those rules, then they are **awarded a badge** in real time.
48+
49+
The frontend that you're looking at now is a web application called [tahrir](https://github.com/fedora-infra/tahrir). We tried as much as we could to keep Tahrir "brand agnostic", so you can install it, run it on your own platform, and issue badges to your friends! Some assembly required.
50+
51+
## How long has the badge awarder been running?
52+
53+
Since August 7th, 2013.
54+
55+
## How long has datanommer been storing the fedmsg history?
56+
57+
Since October 16th, 2012 [(1)](http://threebean.org/blog/datanommer-and-fedmsg-activity/).
58+
59+
## Why exactly can't badges for events be automatically awarded retrospectively?
60+
61+
First, remember that the badge awarding daemon wakes up in response to new [fedmsg](https://github.com/fedora-infra/fedora-messaging) events and that it checks the [history of fedmsg](https://apps.fedoraproject.org/datagrepper) in order to make determinations about who gets what badge at that moment.
62+
63+
To award that Proven Packager badge, the awarder waits for [a message](http://www.fedmsg.com/en/latest/topics/#fas-group-member-sponsor) from the [Fedora Account System (FAS)](https://admin.fedoraproject.org/accounts) indicating that a user has been added to that group. When we receive it, we wake up, verify it, and award the badge.
64+
65+
Since you've been a member of that group for longer than the badge awarder has been running it has never had the occasion to check if you should be awarded the badge. At the time of the launch of Fedora Badges, we've been working around this by manually running a script every few days that doles out these group-based badges to newly-logged-in users. We really should put it in a cronjob to make our lives easier.
66+
67+
Of course, we can't use a simple script to retroactively award badges based on large and complex pre-fedmsg activity like package builds, so many Badgers won't have as many badges for package builds and similar activity as they really ought to. The fedmsg project only started in 2012 and the history only [started being tracked in October of that year](http://threebean.org/blog/datanommer-and-fedmsg-activity/). Koji events didn't come until much later, until January 2013. So Fedora Badges only knows about your builds since then. Don't be disheartened! There's so much more to hack and do.
68+
69+
There's a tentative plan to write a bigger script that will go back over old Koji logs and so on, generate appropriate fedmsg messages but (of course!) not actually broadcast them, and instead feed them straight into datanommer. That should let us catch up on a lot of old activity.
70+
71+
## Can I embed my badges in my blog?
72+
73+
Our frontend app doesn't provide the tools directly, but we do allow you to export your badges to Mozilla's [Open Badges Backpack](https://backpack.openbadges.org) and _they_ provide [some tools for embedding your badges elsewhere](https://github.com/mozilla/openbadges/wiki/Open-Badges-related-widgets).
74+
75+
Click the _Export Badges_ button on your profile, login via Mozilla's "Persona" with your `FASUSERNAME@fedoraproject.org` email address, and create custom badge displays there.

frontend/src/components/accoitem.jsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
1+
import { useState } from "react";
12
import { Col, Image, OverlayTrigger, Popover } from "react-bootstrap";
23
import { Link } from "react-router";
34

45
import { obtainRarityBack, obtainRarityEdge, obtainRarityText, relativeImageUrl } from "../features/util.js";
56

67
export default function AccoItem({ iden, name, body, foot, shot, rare }) {
8+
const [show, makeShow] = useState(false);
9+
710
if (shot) {
811
shot = relativeImageUrl(shot);
912
}
1013

1114
return (
1215
<OverlayTrigger
1316
placement="auto"
17+
show={show}
18+
onToggle={makeShow}
1419
overlay={
15-
<Popover className={`bodyelem ${obtainRarityEdge(rare)}`}>
20+
<Popover
21+
className={`bodyelem ${obtainRarityEdge(rare)}`}
22+
onMouseEnter={() => makeShow(true)}
23+
onMouseLeave={() => makeShow(false)}
24+
>
1625
<Popover.Header
1726
className={`p-2 fw-bold text-truncate ${obtainRarityBack(rare) || "bg-secondary text-white"}`}
1827
>
1928
{name}
2029
</Popover.Header>
21-
<Popover.Body className="p-2 small">
30+
<Popover.Body className="p-2 small" style={{ userSelect: "text" }}>
2231
<p>{body}</p>
2332
<p className="mb-0 text-secondary fst-italic">
24-
<span className={`text-truncate fw-bold ${obtainRarityText(rare)}`}>Rarity {rare}</span> • Created on{" "}
25-
{foot}
33+
<Link
34+
to={`/rarities/${rare}`}
35+
className={`text-truncate fw-bold text-decoration-none ${obtainRarityText(rare)}`}
36+
>
37+
Rarity {rare}
38+
</Link>{" "}
39+
• Created on {foot}
2640
</p>
2741
</Popover.Body>
2842
</Popover>
2943
}
3044
>
31-
<Col xs={3} md={1} lg={1}>
45+
<Col xs={3} md={1} lg={1} onMouseEnter={() => makeShow(true)} onMouseLeave={() => makeShow(false)}>
3246
<Link to={`/accolade/${iden}`} tabIndex="0">
3347
<Image src={shot} className="w-100 h-100" alt={name} />
3448
</Link>

frontend/src/components/findlist.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ export default function FindList({ type, list, hide }) {
1717
>
1818
<Image
1919
rounded={true}
20-
src={
21-
type === "accolade"
22-
? relativeImageUrl(unit.image)
23-
: portraitProvider(unit.email, 40)
24-
}
20+
src={type === "accolade" ? relativeImageUrl(unit.image) : portraitProvider(unit.email, 40)}
2521
width="40"
2622
height="40"
2723
className="me-2"

frontend/src/crud/assertions/create.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Button, Card, Col, Dropdown, FloatingLabel, Form, Image, Row } from "re
33
import { useDispatch } from "react-redux";
44

55
import { useCreationAvermentMutation, useLookupAccoladeQuery, useLookupIdentityQuery } from "../../features/call.js";
6-
import { showBaseNote } from "../../features/part.js";
76
import { useLoadingState } from "../../features/hooks.js";
7+
import { showBaseNote } from "../../features/part.js";
88
import { portraitProvider, relativeImageUrl } from "../../features/util.js";
99

1010
export default function AssertionCreationForm() {

frontend/src/crud/assertions/delete.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Button, Card, Col, Dropdown, FloatingLabel, Form, Image, Row } from "re
33
import { useDispatch } from "react-redux";
44

55
import { useDeletionAvermentMutation, useLookupAccoladeQuery, useLookupIdentityQuery } from "../../features/call.js";
6-
import { showBaseNote } from "../../features/part.js";
76
import { useLoadingState } from "../../features/hooks.js";
7+
import { showBaseNote } from "../../features/part.js";
88
import { portraitProvider, relativeImageUrl } from "../../features/util.js";
99

1010
export default function AssertionDeleteForm() {

frontend/src/crud/authorizations/create.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Button, Card, Col, Dropdown, FloatingLabel, Form, Image, Row } from "re
33
import { useDispatch } from "react-redux";
44

55
import { useCreationSanctionMutation, useLookupAccoladeQuery, useLookupIdentityQuery } from "../../features/call.js";
6-
import { showBaseNote } from "../../features/part.js";
76
import { useLoadingState } from "../../features/hooks.js";
7+
import { showBaseNote } from "../../features/part.js";
88
import { portraitProvider, relativeImageUrl } from "../../features/util.js";
99

1010
export default function AuthorizationCreationForm() {

frontend/src/crud/authorizations/delete.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Button, Card, Col, Dropdown, FloatingLabel, Form, Image, Row } from "re
33
import { useDispatch } from "react-redux";
44

55
import { useDeletionSanctionMutation, useLookupAccoladeQuery, useLookupIdentityQuery } from "../../features/call.js";
6-
import { showBaseNote } from "../../features/part.js";
76
import { useLoadingState } from "../../features/hooks.js";
7+
import { showBaseNote } from "../../features/part.js";
88
import { portraitProvider, relativeImageUrl } from "../../features/util.js";
99

1010
export default function AuthorizationDeletionForm() {

frontend/src/crud/badges/create.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Button, Card, Col, FloatingLabel, Form, Row } from "react-bootstrap";
33
import { useDispatch } from "react-redux";
44

55
import { useCreationAccoladeMutation } from "../../features/call.js";
6-
import { showBaseNote } from "../../features/part.js";
76
import { useLoadingState } from "../../features/hooks.js";
7+
import { showBaseNote } from "../../features/part.js";
88

99
export default function BadgeCreationForm() {
1010
const dispatch = useDispatch();

frontend/src/crud/badges/update.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { useDispatch } from "react-redux";
44
import { useParams } from "react-router";
55

66
import { useLookupAccoladeQuery, useRetrieveAccoladeQuery, useUpdationAccoladeMutation } from "../../features/call.js";
7-
import { showBaseNote } from "../../features/part.js";
87
import { useLoadingState } from "../../features/hooks.js";
8+
import { showBaseNote } from "../../features/part.js";
99
import { formatTime, relativeImageUrl } from "../../features/util.js";
1010

1111
export default function BadgeUpdateForm() {

0 commit comments

Comments
 (0)