Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 5c57c52

Browse files
authored
chore: 2.50.0 release (#3866)
2 parents 1cd4fff + d3a59a8 commit 5c57c52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+469
-645
lines changed

CHANGELOG.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,97 @@
55

66
> All notable changes to this project will be documented in this file
77

8+
## [2.50.0-beta.13](https://github.com/open-sauced/app/compare/v2.50.0-beta.12...v2.50.0-beta.13) (2024-08-06)
9+
10+
11+
### 🐛 Bug Fixes
12+
13+
* remove gradient from metadata tags ([#3856](https://github.com/open-sauced/app/issues/3856)) ([b446fc7](https://github.com/open-sauced/app/commit/b446fc721c19e8d208fa9a642655a4099b2ca676))
14+
15+
## [2.50.0-beta.12](https://github.com/open-sauced/app/compare/v2.50.0-beta.11...v2.50.0-beta.12) (2024-08-05)
16+
17+
18+
### 🍕 Features
19+
20+
* add option to import a SBOM of repositories to a workspace ([#3838](https://github.com/open-sauced/app/issues/3838)) ([ce6b783](https://github.com/open-sauced/app/commit/ce6b78303219d0b1b49db1058409f895cbeb8531))
21+
22+
## [2.50.0-beta.11](https://github.com/open-sauced/app/compare/v2.50.0-beta.10...v2.50.0-beta.11) (2024-08-05)
23+
24+
25+
### 🍕 Features
26+
27+
* converted contributor insight contributor table to new table component ([#3843](https://github.com/open-sauced/app/issues/3843)) ([c91211c](https://github.com/open-sauced/app/commit/c91211c16bff21f43444b55d04265868b76942fc))
28+
29+
## [2.50.0-beta.10](https://github.com/open-sauced/app/compare/v2.50.0-beta.9...v2.50.0-beta.10) (2024-08-05)
30+
31+
32+
### 🐛 Bug Fixes
33+
34+
* **/app/pages/_document.tsx:** add lang attribute to html tag ([#3851](https://github.com/open-sauced/app/issues/3851)) ([d98bc0a](https://github.com/open-sauced/app/commit/d98bc0a702578f7167b87d65fd58467a25cfdffb))
35+
36+
## [2.50.0-beta.9](https://github.com/open-sauced/app/compare/v2.50.0-beta.8...v2.50.0-beta.9) (2024-08-05)
37+
38+
39+
### 🍕 Features
40+
41+
* added a skip link ([#3850](https://github.com/open-sauced/app/issues/3850)) ([83b335a](https://github.com/open-sauced/app/commit/83b335a53e4a8219ab11253a3448e3034ee4da72))
42+
43+
## [2.50.0-beta.8](https://github.com/open-sauced/app/compare/v2.50.0-beta.7...v2.50.0-beta.8) (2024-08-05)
44+
45+
46+
### 🐛 Bug Fixes
47+
48+
* removed some unused code ([#3849](https://github.com/open-sauced/app/issues/3849)) ([70be5b9](https://github.com/open-sauced/app/commit/70be5b9bba379ac2243a6716ba400d0949207417))
49+
50+
## [2.50.0-beta.7](https://github.com/open-sauced/app/compare/v2.50.0-beta.6...v2.50.0-beta.7) (2024-08-02)
51+
52+
53+
### 🍕 Features
54+
55+
* 'Coming Soon' state for OSSF Scorecard ([#3840](https://github.com/open-sauced/app/issues/3840)) ([a36205a](https://github.com/open-sauced/app/commit/a36205afaba8c10c06e8a4bc0173cd9832dd8d41))
56+
57+
## [2.50.0-beta.6](https://github.com/open-sauced/app/compare/v2.50.0-beta.5...v2.50.0-beta.6) (2024-08-02)
58+
59+
60+
### 🐛 Bug Fixes
61+
62+
* OSCR math ceiling for contributor card ([#3839](https://github.com/open-sauced/app/issues/3839)) ([fc9b3e9](https://github.com/open-sauced/app/commit/fc9b3e93ad05f90d81f5e95cf8fa86ed54574d2c))
63+
64+
## [2.50.0-beta.5](https://github.com/open-sauced/app/compare/v2.50.0-beta.4...v2.50.0-beta.5) (2024-08-02)
65+
66+
67+
### 🐛 Bug Fixes
68+
69+
* now using setQueryParams no longer causes page to jump ([#3837](https://github.com/open-sauced/app/issues/3837)) ([6541971](https://github.com/open-sauced/app/commit/6541971dcd6d0930f62e2a41365e7039eaebab35))
70+
71+
## [2.50.0-beta.4](https://github.com/open-sauced/app/compare/v2.50.0-beta.3...v2.50.0-beta.4) (2024-08-02)
72+
73+
74+
### 🐛 Bug Fixes
75+
76+
* now tooltip appears over lock button ([#3832](https://github.com/open-sauced/app/issues/3832)) ([b3274cb](https://github.com/open-sauced/app/commit/b3274cb6296f104daa8fed49e97d85d27a9aa55b))
77+
78+
## [2.50.0-beta.3](https://github.com/open-sauced/app/compare/v2.50.0-beta.2...v2.50.0-beta.3) (2024-08-02)
79+
80+
81+
### 🐛 Bug Fixes
82+
83+
* put back original heading for PR velocity ([#3830](https://github.com/open-sauced/app/issues/3830)) ([e8acd50](https://github.com/open-sauced/app/commit/e8acd50aab41c86601e068027278ae9ba8965823))
84+
85+
## [2.50.0-beta.2](https://github.com/open-sauced/app/compare/v2.50.0-beta.1...v2.50.0-beta.2) (2024-08-02)
86+
87+
88+
### 🐛 Bug Fixes
89+
90+
* removed unused code ([#3827](https://github.com/open-sauced/app/issues/3827)) ([3d28f2c](https://github.com/open-sauced/app/commit/3d28f2cefe93ed20788f170b69a0cdfa01acbb23))
91+
92+
## [2.50.0-beta.1](https://github.com/open-sauced/app/compare/v2.49.0...v2.50.0-beta.1) (2024-08-02)
93+
94+
95+
### 🍕 Features
96+
97+
* OSCR works with API range 0-300 and uses ceiling math ([#3829](https://github.com/open-sauced/app/issues/3829)) ([23ae445](https://github.com/open-sauced/app/commit/23ae445a9247e954981db43bf2db0dcf8050acb4))
98+
899
## [2.49.0](https://github.com/open-sauced/app/compare/v2.48.0...v2.49.0) (2024-08-01)
9100

10101

components/Contributors/Oscr.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const OSCR_LOGIN_TEXT = "Log in to view Open Source Contributor Rating (O
1717

1818
export const OscrPill = ({ rating, hideRating, signIn = DEFAULT_SIGN_IN }: OscrProps) => {
1919
const posthog = usePostHog();
20-
let ratingToRender = rating ? Math.floor(rating * 100) : 0;
20+
let ratingToRender = rating ? Math.ceil(rating) : 0;
2121

2222
if (ratingToRender < 1) {
2323
ratingToRender = 0;
@@ -29,10 +29,10 @@ export const OscrPill = ({ rating, hideRating, signIn = DEFAULT_SIGN_IN }: OscrP
2929
<Tooltip direction="top" content={tooltipText}>
3030
{hideRating ? (
3131
<div className="relative flex items-center justify-center w-fit">
32-
<span className="absolute blur-sm text-xl text-purple-00 z-0 leading-tight">000</span>
32+
<span className="absolute blur-sm text-xl text-purple-00 leading-tight">000</span>
3333
<Button
3434
variant="primary"
35-
className="flex items-center gap-2 !p-1 !text-xs z-10"
35+
className="flex items-center gap-2 !p-1 !text-xs z-0"
3636
onClick={() => {
3737
posthog.capture("OSCR Login Button Clicked");
3838
signIn({ provider: "github", options: { redirectTo: window.location.href } });
@@ -51,7 +51,7 @@ export const OscrPill = ({ rating, hideRating, signIn = DEFAULT_SIGN_IN }: OscrP
5151

5252
export const OscrButton = ({ rating, hideRating, signIn = DEFAULT_SIGN_IN }: OscrProps) => {
5353
const posthog = usePostHog();
54-
let ratingToRender = rating ? Math.floor(rating * 100) : 0;
54+
let ratingToRender = rating ? Math.ceil(rating) : 0;
5555

5656
const tooltipText = hideRating
5757
? "Log in to view Open Source Contributor Rating (OSCR)"

components/Repositories/OssfChart.tsx

Lines changed: 104 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
import { useMemo } from "react";
1+
import { useMemo, useState } from "react";
22
import { FaShieldAlt } from "react-icons/fa";
33
import { Cell, Pie, PieChart, ResponsiveContainer } from "recharts";
4+
import { usePostHog } from "posthog-js/react";
45
import SkeletonWrapper from "components/atoms/SkeletonLoader/skeleton-wrapper";
56
import Card from "components/atoms/Card/card";
7+
import Button from "components/shared/Button/button";
8+
import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
9+
import { useToast } from "lib/hooks/useToast";
10+
import OssfRequestModal from "./OssfRequestModal";
611

712
type OssfChartProps = {
13+
repository: string;
814
totalScore: number | null;
915
dependencyUpdateScore: number | null;
1016
fuzzingScore: number | null;
@@ -16,6 +22,7 @@ type OssfChartProps = {
1622
};
1723

1824
export default function OssfChart({
25+
repository,
1926
totalScore,
2027
dependencyUpdateScore,
2128
fuzzingScore,
@@ -25,6 +32,10 @@ export default function OssfChart({
2532
onLearnMoreClick,
2633
className,
2734
}: OssfChartProps) {
35+
const posthog = usePostHog();
36+
const { toast } = useToast();
37+
const { user } = useSupabaseAuth();
38+
const [isOssfRequestModalOpen, setIsOssfRequestModalOpen] = useState(false);
2839
const data = useMemo(
2940
() => [
3041
{ name: "totalScore", value: totalScore ?? 0 },
@@ -33,6 +44,18 @@ export default function OssfChart({
3344
[totalScore]
3445
);
3546

47+
const onRequestClick = () => {
48+
if (!user) {
49+
setIsOssfRequestModalOpen(true);
50+
} else {
51+
posthog.capture(`Repo Page: requested OpenSSF score`, {
52+
repository,
53+
email: user.email,
54+
});
55+
toast({ description: "Request sent! We'll notify you when it's ready.", variant: "success" });
56+
}
57+
};
58+
3659
const getValueBasedOnScore = ({
3760
low,
3861
med,
@@ -52,17 +75,18 @@ export default function OssfChart({
5275
const pieColor = getValueBasedOnScore({ low: "#f59e0b", med: "#2563eb", high: "#22c55e", error: "#e2e8f0" });
5376

5477
const projectStatus = getValueBasedOnScore({
55-
low: "might not be safe to use",
56-
med: "is safe to use",
57-
high: "is safe to use",
58-
error: "hasn't been calculated yet.",
78+
low: "This project might not be safe to use",
79+
med: "This project is safe to use",
80+
high: "This project is safe to use",
81+
error: "Coming soon!",
5982
});
6083

6184
const projectDescription = getValueBasedOnScore({
6285
low: "It might not pass all checks in the OpenSSF software security checklist. ",
6386
med: "It passes almost all checks in the OpenSSF software security checklist. ",
6487
high: "It passes almost all checks in the OpenSSF software security checklist with a high score. ",
65-
error: "No checks have been tested from the OpenSSF software security checklist. ",
88+
error:
89+
"We are still calculating the OpenSSF Score for this repository that measures the security level of the project.",
6690
});
6791

6892
const renderCustomLabel = ({ cx, cy }: { cx: number; cy: number }) => {
@@ -75,62 +99,81 @@ export default function OssfChart({
7599
};
76100

77101
return (
78-
<Card className={`${className ?? ""} flex flex-col gap-4 w-full h-fit items-center py-8`}>
79-
<header className="flex items-center justify-between w-full px-4">
80-
<div className="flex items-center gap-2">
81-
<FaShieldAlt className="text-xl" />
82-
<h3 className="text-sm font-semibold xl:text-lg text-slate-800">OpenSSF Score</h3>
83-
</div>
84-
<a
85-
href="https://opensauced.pizza/docs/features/repo-pages/#insights-into-the-ossf-scorecard"
86-
onClick={onLearnMoreClick}
87-
className="text-xs font-semibold text-sauced-orange xl:text-sm hover:underline"
88-
>
89-
Learn More
90-
</a>
91-
</header>
92-
93-
{!isError && (isLoading || !totalScore) ? ( // check if other scores are null
94-
<SkeletonWrapper width={300} height={100} />
95-
) : (
96-
<section className="flex justify-between w-full gap-2 lg:flex-col xl:flex-row h-fit max-h-24 lg:max-h-full xl:max-h-24">
97-
<div className="w-full !max-w-[14rem] lg:max-w-full lg:mx-auto h-full lg:max-h-24 xl:h-full">
98-
<ResponsiveContainer width="100%" height={150}>
99-
<PieChart>
100-
<Pie
101-
data={data}
102-
label={renderCustomLabel}
103-
labelLine={false}
104-
dataKey="value"
105-
startAngle={180}
106-
endAngle={0}
107-
innerRadius={40}
108-
paddingAngle={0}
109-
>
110-
{data.map((entry, index) => (
111-
<Cell key={`cell-${index}`} fill={entry.name === "totalScore" ? pieColor : "#e2e8f0"} />
112-
))}
113-
</Pie>
114-
</PieChart>
115-
</ResponsiveContainer>
102+
<>
103+
<Card className={`${className ?? ""} flex flex-col gap-4 w-full h-fit items-center py-8`}>
104+
<header className="flex items-center justify-between w-full px-4">
105+
<div className="flex items-center gap-2">
106+
<FaShieldAlt className="text-xl" />
107+
<h3 className="text-sm font-semibold xl:text-lg text-slate-800">OpenSSF Score</h3>
116108
</div>
117-
<section className="flex flex-col gap-1 lg:text-center xl:text-start">
118-
<h3 className="font-medium text-sm text-slate-700">This project {projectStatus}</h3>
119-
<p className="text-xs text-slate-600">
120-
{projectDescription}
121-
You can run the full test{" "}
122-
<a
123-
href="https://github.com/ossf/scorecard?tab=readme-ov-file#view-a-projects-score"
124-
target="_blank"
125-
className="text-orange-500"
126-
>
127-
here
128-
</a>
129-
.
130-
</p>
109+
<a
110+
href="https://opensauced.pizza/docs/features/repo-pages/#insights-into-the-ossf-scorecard"
111+
onClick={onLearnMoreClick}
112+
className="text-xs font-semibold text-sauced-orange xl:text-sm hover:underline"
113+
>
114+
Learn More
115+
</a>
116+
</header>
117+
118+
{!isError && (isLoading || !totalScore) ? ( // check if other scores are null
119+
<SkeletonWrapper width={300} height={100} />
120+
) : (
121+
<section className="flex justify-between items-center w-full gap-2 lg:flex-col xl:flex-row h-fit max-h-24 lg:max-h-full xl:max-h-24">
122+
<div className="relative w-full !max-w-[14rem] lg:max-w-full lg:mx-auto h-full lg:max-h-24 xl:h-full">
123+
{isError && (
124+
<div className="absolute inset-0 z-50 flex items-center justify-center">
125+
<Button variant="primary" onClick={onRequestClick} className="!text-xs">
126+
I want this now!
127+
</Button>
128+
</div>
129+
)}
130+
<ResponsiveContainer width="100%" height={150} className={`${isError && "blur-[2.5px]"}`}>
131+
<PieChart>
132+
<Pie
133+
data={data}
134+
label={renderCustomLabel}
135+
labelLine={false}
136+
dataKey="value"
137+
startAngle={180}
138+
endAngle={0}
139+
innerRadius={40}
140+
paddingAngle={0}
141+
>
142+
{data.map((entry, index) => (
143+
<Cell key={`cell-${index}`} fill={entry.name === "totalScore" ? pieColor : "#e2e8f0"} />
144+
))}
145+
</Pie>
146+
</PieChart>
147+
</ResponsiveContainer>
148+
</div>
149+
<section className="flex flex-col gap-1 lg:text-center xl:text-start">
150+
<h3 className="font-medium text-sm text-slate-700">{projectStatus}</h3>
151+
<p className="text-xs text-slate-600">
152+
{projectDescription}
153+
{!isError && (
154+
<span>
155+
You can run the full test{" "}
156+
<a
157+
href="https://github.com/ossf/scorecard?tab=readme-ov-file#view-a-projects-score"
158+
target="_blank"
159+
className="text-orange-500"
160+
>
161+
here
162+
</a>
163+
.
164+
</span>
165+
)}
166+
</p>
167+
</section>
131168
</section>
132-
</section>
133-
)}
134-
</Card>
169+
)}
170+
</Card>
171+
172+
<OssfRequestModal
173+
repository={repository}
174+
isOpen={isOssfRequestModalOpen}
175+
onClose={() => setIsOssfRequestModalOpen(false)}
176+
/>
177+
</>
135178
);
136179
}

0 commit comments

Comments
 (0)