From f4d03c8454e56968a8e730aabb46ff6774e5e399 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 2 Apr 2024 14:54:48 -0600 Subject: [PATCH 01/20] Fix performance issue on the status page Signed-off-by: Florent Poinsard --- go/exec/exec.go | 24 ++---------------------- go/server/api.go | 2 +- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/go/exec/exec.go b/go/exec/exec.go index 90d336ca9..973524fa0 100644 --- a/go/exec/exec.go +++ b/go/exec/exec.go @@ -49,6 +49,7 @@ const ( type Exec struct { UUID uuid.UUID + RawUUID string AnsibleConfig ansible.Config Source string GitRef string @@ -456,32 +457,11 @@ func GetRecentExecutions(client storage.SQLClient) ([]*Exec, error) { } defer result.Close() for result.Next() { - var eUUID string exec := &Exec{} - err = result.Scan(&eUUID, &exec.Status, &exec.GitRef, &exec.StartedAt, &exec.FinishedAt, &exec.Source, &exec.TypeOf, &exec.PullNB, &exec.GolangVersion) + err = result.Scan(&exec.RawUUID, &exec.Status, &exec.GitRef, &exec.StartedAt, &exec.FinishedAt, &exec.Source, &exec.TypeOf, &exec.PullNB, &exec.GolangVersion) if err != nil { return nil, err } - exec.UUID, err = uuid.Parse(eUUID) - if err != nil { - return nil, err - } - if exec.TypeOf != "micro" { - macroResult, err := client.Select("SELECT m.vtgate_planner_version FROM macrobenchmark m, execution e WHERE e.uuid = m.exec_uuid AND e.uuid = ? LIMIT 1", eUUID) - if err != nil { - return nil, err - } - defer macroResult.Close() - - var plannerVersion string - if macroResult.Next() { - err = macroResult.Scan(&plannerVersion) - if err != nil { - return nil, err - } - } - exec.VtgatePlannerVersion = plannerVersion - } res = append(res, exec) } return res, nil diff --git a/go/server/api.go b/go/server/api.go index 22402978d..9c309c5e1 100644 --- a/go/server/api.go +++ b/go/server/api.go @@ -60,7 +60,7 @@ func (s *Server) getRecentExecutions(c *gin.Context) { recentExecs := make([]RecentExecutions, 0, len(execs)) for _, e := range execs { recentExecs = append(recentExecs, RecentExecutions{ - UUID: e.UUID.String(), + UUID: e.RawUUID, Source: e.Source, GitRef: e.GitRef, Status: e.Status, From 47b10e9058df461eecb95cba101683144e182e00 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Wed, 3 Apr 2024 15:41:09 -0600 Subject: [PATCH 02/20] optimize queue to only run the latest Signed-off-by: Florent Poinsard --- go/server/cron_handlers.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/go/server/cron_handlers.go b/go/server/cron_handlers.go index 2f0a5e266..a315a221a 100644 --- a/go/server/cron_handlers.go +++ b/go/server/cron_handlers.go @@ -48,10 +48,26 @@ func (s *Server) branchCronHandler() { execElements := append(mainBranchElements, releaseBranchElements...) for _, elem := range execElements { + s.removeBranchElementFromQueue(elem) s.addToQueue(elem) } } +func (s *Server) removeBranchElementFromQueue(newElem *executionQueueElement) { + mtx.Lock() + defer mtx.Unlock() + + for identifier, element := range queue { + if element.Executing { + continue + } + if identifier.PlannerVersion == newElem.identifier.PlannerVersion && identifier.BenchmarkType == newElem.identifier.BenchmarkType && identifier.Source == newElem.identifier.Source && identifier.GitRef != newElem.identifier.GitRef { + slog.Infof("%+v is removed from the queue", identifier) + delete(queue, identifier) + } + } +} + func (s *Server) mainBranchCronHandler() ([]*executionQueueElement, error) { var elements []*executionQueueElement configs := s.getConfigFiles() From 46b6f298fbd008511245ef4137ffa4e22b1c669a Mon Sep 17 00:00:00 2001 From: Mintu Gogoi Date: Mon, 22 Apr 2024 20:57:44 +0000 Subject: [PATCH 03/20] make the table of status page responsive --- website/src/common/DisplayList.tsx | 72 +++++++++++++++++++----------- 1 file changed, 47 insertions(+), 25 deletions(-) diff --git a/website/src/common/DisplayList.tsx b/website/src/common/DisplayList.tsx index b831afc1c..b5b9955ca 100644 --- a/website/src/common/DisplayList.tsx +++ b/website/src/common/DisplayList.tsx @@ -19,32 +19,54 @@ export default function DisplayList(props) { const { data } = props; return ( - - - - {Object.keys(data[0]).map((item, key) => ( - - ))} - - - - {data.map((val, key) => { - return ( - - {Object.keys(val).map((item, key) => ( - +
+
+ {data.map((val, key) => ( +
+ {Object.keys(val).map((item, itemKey) => ( +
+ {item} + {val[item]} +
+ ))} +
+ ))} +
+
+
- {item} -
- {val[item]} -
+ + + {Object.keys(data[0]).map((item, key) => ( + ))} - ); - })} - -
+ {item} +
+ + + {data.map((val, key) => { + return ( + + {Object.keys(val).map((item, key) => ( + + {val[item]} + + ))} + + ); + })} + + + + ); } From fe52fff1208332b0d9962a44db40c7d205d112a8 Mon Sep 17 00:00:00 2001 From: Mintu Gogoi Date: Wed, 24 Apr 2024 09:53:04 +0000 Subject: [PATCH 04/20] fixed the width of full screen and added config for medium screen --- website/src/common/DisplayList.tsx | 2 +- website/tailwind.config.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/website/src/common/DisplayList.tsx b/website/src/common/DisplayList.tsx index b5b9955ca..c4edbcbe4 100644 --- a/website/src/common/DisplayList.tsx +++ b/website/src/common/DisplayList.tsx @@ -44,7 +44,7 @@ export default function DisplayList(props) { {Object.keys(data[0]).map((item, key) => ( {item} diff --git a/website/tailwind.config.ts b/website/tailwind.config.ts index b8bd85a84..5d150e521 100644 --- a/website/tailwind.config.ts +++ b/website/tailwind.config.ts @@ -81,7 +81,8 @@ const config = { }, screens: { mobile: { max: "780px" }, - widescreen: { min: "780px" }, + midscreen: { max: "1280px"}, + widescreen: { min: "1280px" }, }, transitionDuration: { inherit: "inherit", From 78650970376a06e85dcb13b1eafc7575961aa899 Mon Sep 17 00:00:00 2001 From: utnim2 Date: Wed, 24 Apr 2024 20:40:58 +0530 Subject: [PATCH 05/20] removed the bug of not showing the table completely --- website/src/common/DisplayList.tsx | 8 ++++---- website/tailwind.config.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/src/common/DisplayList.tsx b/website/src/common/DisplayList.tsx index c4edbcbe4..c12be4441 100644 --- a/website/src/common/DisplayList.tsx +++ b/website/src/common/DisplayList.tsx @@ -19,7 +19,7 @@ export default function DisplayList(props) { const { data } = props; return ( -
+
{data.map((val, key) => (
))}
-
- +
+
{Object.keys(data[0]).map((item, key) => ( - + ); } @@ -276,10 +293,10 @@ Row.propTypes = { infinite: PropTypes.bool.isRequired, unknown: PropTypes.bool.isRequired, value: PropTypes.number.isRequired, - }) + }), }).isRequired, delta: PropTypes.number.isRequired, insignificant: PropTypes.bool.isRequired, p: PropTypes.string.isRequired, - fmt: PropTypes.oneOf(['none', 'time', 'memory']).isRequired, -}; \ No newline at end of file + fmt: PropTypes.oneOf(["none", "time", "memory"]).isRequired, +}; diff --git a/website/src/common/Modal.tsx b/website/src/common/Modal.tsx index 679c38ba2..2f96ccad6 100644 --- a/website/src/common/Modal.tsx +++ b/website/src/common/Modal.tsx @@ -24,13 +24,13 @@ export default function Modal() {
{modal.element} diff --git a/website/src/common/Navbar.tsx b/website/src/common/Navbar.tsx index fe48a401a..c8361e57a 100644 --- a/website/src/common/Navbar.tsx +++ b/website/src/common/Navbar.tsx @@ -42,7 +42,7 @@ export default function Navbar() {
{Object.entries(data).map(([key, value]) => { - var val = extract({value: value}); - return ( + var val = extract({ value: value }); + return ( ); })} - ); + ); } Row.propTypes = { - title: PropTypes.string.isRequired, - extract: PropTypes.func.isRequired, - data: PropTypes.object.isRequired, - fmt: PropTypes.oneOf(['time', 'memory']), -}; \ No newline at end of file + title: PropTypes.string.isRequired, + extract: PropTypes.func.isRequired, + data: PropTypes.object.isRequired, + fmt: PropTypes.oneOf(["time", "memory"]), +}; diff --git a/website/src/pages/ForeignKeysPage/components/Hero.tsx b/website/src/pages/ForeignKeysPage/components/Hero.tsx index fb08d9470..0b8513055 100644 --- a/website/src/pages/ForeignKeysPage/components/Hero.tsx +++ b/website/src/pages/ForeignKeysPage/components/Hero.tsx @@ -71,7 +71,7 @@ export default function Hero(props: { className={twMerge( "w-[20vw] relative border-front border border-t-transparent border-opacity-60 bg-background py-2 font-medium hover:bg-accent", key === 0 && "rounded-t border-t-front", - key === refs.length - 1 && "rounded-b" + key === refs.length - 1 && "rounded-b", )} > {ref.Name} diff --git a/website/src/pages/HomePage/components/MicroAndMacro.tsx b/website/src/pages/HomePage/components/MicroAndMacro.tsx index b430452bb..73da8eac8 100644 --- a/website/src/pages/HomePage/components/MicroAndMacro.tsx +++ b/website/src/pages/HomePage/components/MicroAndMacro.tsx @@ -98,12 +98,16 @@ export default function MicroAndMacro() {
{items.map((item, key) => (
-

{item.title}

+

+ {item.title} +

    {item.points.map((point, i) => (
  • {point.title}
    -

    {point.content}

    +

    + {point.content} +

  • ))}
diff --git a/website/src/pages/MacroPage/MacroPage.tsx b/website/src/pages/MacroPage/MacroPage.tsx index e26fa40ac..1ac95dbc5 100644 --- a/website/src/pages/MacroPage/MacroPage.tsx +++ b/website/src/pages/MacroPage/MacroPage.tsx @@ -40,7 +40,7 @@ const Macro = () => { async function loadRefs() { try { const responseRefs = await fetch( - `${import.meta.env.VITE_API_URL}vitess/refs` + `${import.meta.env.VITE_API_URL}vitess/refs`, ); const jsonDataRefs = await responseRefs.json(); setDataRefs(jsonDataRefs); @@ -61,7 +61,7 @@ const Macro = () => { const responseMacrobench = await fetch( `${import.meta.env.VITE_API_URL}macrobench/compare?old=${ commits.old - }&new=${commits.new}` + }&new=${commits.new}`, ); const jsonDataMacrobench = await responseMacrobench.json(); setDataMacrobench(jsonDataMacrobench); diff --git a/website/src/pages/MacroPage/components/Hero.tsx b/website/src/pages/MacroPage/components/Hero.tsx index 1bc3d8b4d..6559451df 100644 --- a/website/src/pages/MacroPage/components/Hero.tsx +++ b/website/src/pages/MacroPage/components/Hero.tsx @@ -45,7 +45,7 @@ export default function Hero(props: { className={twMerge( "w-[20vw] relative border-front border border-t-transparent border-opacity-60 bg-background py-2 font-medium hover:bg-accent", key === 0 && "rounded-t border-t-front", - key === refs.length - 1 && "rounded-b" + key === refs.length - 1 && "rounded-b", )} > {ref.Name} @@ -71,7 +71,7 @@ export default function Hero(props: { "w-[20vw] relative border-front border border-t-transparent border-opacity-60 bg-background py-2 font-medium hover:bg-accent", key === 0 && "rounded-t border-t-front", - key === refs.length - 1 && "rounded-b" + key === refs.length - 1 && "rounded-b", )} > {ref.Name} diff --git a/website/src/pages/MacroQueriesComparePage/MacroQueriesComparePage.tsx b/website/src/pages/MacroQueriesComparePage/MacroQueriesComparePage.tsx index 5c8669cfa..81e9c9165 100644 --- a/website/src/pages/MacroQueriesComparePage/MacroQueriesComparePage.tsx +++ b/website/src/pages/MacroQueriesComparePage/MacroQueriesComparePage.tsx @@ -46,7 +46,7 @@ export default function MacroQueriesComparePage() { const responseQueryPlan = await fetch( `${import.meta.env.VITE_API_URL}macrobench/compare/queries?ltag=${ commits.left - }&rtag=${commits.right}&type=${type}` + }&rtag=${commits.right}&type=${type}`, ); const jsonDataQueryPlan = await responseQueryPlan.json(); @@ -71,7 +71,7 @@ export default function MacroQueriesComparePage() { type === "null" ) { setError( - "Error: Some URL parameters are missing. Please provide both 'ltag', 'rtag' and type parameters." + "Error: Some URL parameters are missing. Please provide both 'ltag', 'rtag' and type parameters.", ); } else { loadData(); diff --git a/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx b/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx index fe1f129cd..f0f07062d 100644 --- a/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx +++ b/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx @@ -59,7 +59,7 @@ function Badge({ type, content }) { "px-5 py-1 rounded-full w-max text-sm text-white font-medium", type === "error" && "bg-red-600", type === "warning" && "bg-purple-700", - type === "info" && "bg-sky-600" + type === "info" && "bg-sky-600", )} > {content} @@ -145,7 +145,7 @@ function DetailsModal({ data }) {
diff --git a/website/src/pages/MicroPage/MicroPage.tsx b/website/src/pages/MicroPage/MicroPage.tsx index 6cf96c444..3366110b9 100644 --- a/website/src/pages/MicroPage/MicroPage.tsx +++ b/website/src/pages/MicroPage/MicroPage.tsx @@ -32,10 +32,10 @@ import Microbench from "./components/Microbench/Microbench"; export default function MicroPage() { const urlParams = new URLSearchParams(window.location.search); const [gitRefLeft, setGitRefLeft] = useState( - urlParams.get("ltag") == null ? "Left" : urlParams.get("ltag") + urlParams.get("ltag") == null ? "Left" : urlParams.get("ltag"), ); const [gitRefRight, setGitRefRight] = useState( - urlParams.get("rtag") == null ? "Right" : urlParams.get("rtag") + urlParams.get("rtag") == null ? "Right" : urlParams.get("rtag"), ); const [openDropDownLeft, setOpenDropDownLeft] = useState(closeDropDownValue); const [openDropDownRight, setOpenDropDownRight] = @@ -52,7 +52,7 @@ export default function MicroPage() { const fetchData = async () => { try { const responseRefs = await fetch( - `${import.meta.env.VITE_API_URL}vitess/refs` + `${import.meta.env.VITE_API_URL}vitess/refs`, ); const jsonDataRefs = await responseRefs.json(); @@ -81,7 +81,7 @@ export default function MicroPage() { const responseMicrobench = await fetch( `${ import.meta.env.VITE_API_URL - }microbench/compare?rtag=${commitHashRight}<ag=${commitHashLeft}` + }microbench/compare?rtag=${commitHashRight}<ag=${commitHashLeft}`, ); const jsonDataMicrobench = await responseMicrobench.json(); setDataMicrobench(jsonDataMicrobench); @@ -130,7 +130,7 @@ export default function MicroPage() { ref, setGitRefLeft, setCommitHashLeft, - setOpenDropDownLeft + setOpenDropDownLeft, ); }} > @@ -164,7 +164,7 @@ export default function MicroPage() { ref, setGitRefRight, setCommitHashRight, - setOpenDropDownRight + setOpenDropDownRight, ) } > diff --git a/website/src/pages/MicroPage/components/Microbench/Microbench.tsx b/website/src/pages/MicroPage/components/Microbench/Microbench.tsx index 1e3a6db62..91d6d2a22 100644 --- a/website/src/pages/MicroPage/components/Microbench/Microbench.tsx +++ b/website/src/pages/MicroPage/components/Microbench/Microbench.tsx @@ -48,8 +48,8 @@ const Microbench = ({ data, className, gitRefLeft, gitRefRight }) => { data.Diff.Ops <= -5 ? "negatif--Micro" : data.Diff.Ops >= 5 - ? "positif--Micro" - : "" + ? "positif--Micro" + : "" }`} > {data.Diff.Ops.toFixed(2)} @@ -63,8 +63,8 @@ const Microbench = ({ data, className, gitRefLeft, gitRefRight }) => { data.Diff.Ops <= -10 ? "negatif--Micro" : data.Diff.Ops >= 10 - ? "positif--Micro" - : "" + ? "positif--Micro" + : "" }`} > {data.Diff.NSPerOp.toFixed(2)} @@ -91,8 +91,8 @@ const Microbench = ({ data, className, gitRefLeft, gitRefRight }) => { data.Diff.Ops <= -5 ? "negatif--Micro" : data.Diff.Ops >= 5 - ? "positif--Micro" - : "" + ? "positif--Micro" + : "" }`} > {data.Diff.Ops.toFixed(2)} @@ -107,8 +107,8 @@ const Microbench = ({ data, className, gitRefLeft, gitRefRight }) => { data.Diff.Ops <= -10 ? "negatif--Micro" : data.Diff.Ops >= 10 - ? "positif--Micro" - : "" + ? "positif--Micro" + : "" }`} > {data.Diff.NSPerOp.toFixed(2)} @@ -123,8 +123,8 @@ const Microbench = ({ data, className, gitRefLeft, gitRefRight }) => { data.Diff.Ops <= -10 ? "negatif--Micro" : data.Diff.Ops >= 10 - ? "positif--Micro" - : "" + ? "positif--Micro" + : "" }`} > {data.Diff.BytesPerOp.toFixed(2)} @@ -139,8 +139,8 @@ const Microbench = ({ data, className, gitRefLeft, gitRefRight }) => { data.Diff.Ops <= -10 ? "negatif--Micro" : data.Diff.Ops >= 10 - ? "positif--Micro" - : "" + ? "positif--Micro" + : "" }`} > {data.Diff.MBPerSec.toFixed(2)} @@ -155,8 +155,8 @@ const Microbench = ({ data, className, gitRefLeft, gitRefRight }) => { data.Diff.Ops <= -10 ? "negatif--Micro" : data.Diff.Ops >= 10 - ? "positif--Micro" - : "" + ? "positif--Micro" + : "" }`} > {data.Diff.AllocsPerOp.toFixed(2)} diff --git a/website/src/pages/MicroPage/components/Microbench/microbench.css b/website/src/pages/MicroPage/components/Microbench/microbench.css index c2868f567..ffb457d2a 100644 --- a/website/src/pages/MicroPage/components/Microbench/microbench.css +++ b/website/src/pages/MicroPage/components/Microbench/microbench.css @@ -14,60 +14,59 @@ See the License for the specific language governing permissions and limitations under the License. */ -.microbench{ - display: flex; - flex-direction: column; - padding: 20px 0px; - text-align: center; - border-top: 1px solid #B5ADAD; - overflow: hidden; - transition: 0.8s; - font-weight: 200; +.microbench { + display: flex; + flex-direction: column; + padding: 20px 0px; + text-align: center; + border-top: 1px solid #b5adad; + overflow: hidden; + transition: 0.8s; + font-weight: 200; } -.name{ - word-wrap: break-word; - width: 30%; +.name { + word-wrap: break-word; + width: 30%; } -.microbench__bottom{ - border: #B5ADAD 1px solid; - width: 75%; - max-width: 800px; - margin: auto; - padding: 15px; - margin-top: 30px; - +.microbench__bottom { + border: #b5adad 1px solid; + width: 75%; + max-width: 800px; + margin: auto; + padding: 15px; + margin-top: 30px; } -.microbench__bottom__line{ - border-bottom:#B5ADAD solid 2px; - margin: 10px 0px; +.microbench__bottom__line { + border-bottom: #b5adad solid 2px; + margin: 10px 0px; } -.microbenchMore{ - padding: 10px 0px; - font-weight: 200; +.microbenchMore { + padding: 10px 0px; + font-weight: 200; } -.positif--Micro{ - background-color: green; - border-radius: 20px; - padding: 5px 0px; +.positif--Micro { + background-color: green; + border-radius: 20px; + padding: 5px 0px; } -.negatif--Micro{ - background-color: red; - border-radius: 20px; - padding: 5px 0px; +.negatif--Micro { + background-color: red; + border-radius: 20px; + padding: 5px 0px; } /* MEDIA QUERIES FOR TABLETS */ @media only screen and (max-width: 767px) { - .microbench__bottom{ - width: 98%; - } - .name{ - width: 50%; - } + .microbench__bottom { + width: 98%; + } + .name { + width: 50%; + } } diff --git a/website/src/pages/MicroPage/micro.css b/website/src/pages/MicroPage/micro.css index 5d91ef6b9..27bf062d1 100644 --- a/website/src/pages/MicroPage/micro.css +++ b/website/src/pages/MicroPage/micro.css @@ -44,7 +44,7 @@ limitations under the License. position: relative; } -.micro__bottom__DropDownCointainer{ +.micro__bottom__DropDownCointainer { position: relative; width: 100%; height: 200px; @@ -125,7 +125,7 @@ limitations under the License. display: none; } -.benchmarkName{ +.benchmarkName { width: 30%; } @@ -151,10 +151,10 @@ limitations under the License. height: 300px; margin-top: 100px; } - .micro__bottom__DropDownLeft{ + .micro__bottom__DropDownLeft { width: 170px; } - .micro__bottom__DropDownRight{ + .micro__bottom__DropDownRight { width: 170px; } } @@ -206,10 +206,10 @@ limitations under the License. font-size: 0.7rem; width: 150px; } - .micro__bottom__DropDownCointainer{ + .micro__bottom__DropDownCointainer { margin: auto; } - .benchmarkName{ + .benchmarkName { width: 50%; } } diff --git a/website/src/pages/PRPage/PRPage.tsx b/website/src/pages/PRPage/PRPage.tsx index 1dcf5a80f..3c2c0b2be 100644 --- a/website/src/pages/PRPage/PRPage.tsx +++ b/website/src/pages/PRPage/PRPage.tsx @@ -51,7 +51,9 @@ export default function PRPage() {
)} - {singlePrError &&
{errorApi}
} + {singlePrError && ( +
{errorApi}
+ )} {!singlePrLoading && dataSinglePr && (
diff --git a/website/src/pages/PRsPage/PRsPage.tsx b/website/src/pages/PRsPage/PRsPage.tsx index 6590ff362..d3d41811b 100644 --- a/website/src/pages/PRsPage/PRsPage.tsx +++ b/website/src/pages/PRsPage/PRsPage.tsx @@ -39,7 +39,9 @@ export default function PRsPage() {
)} - {PRListError ?
{PRListError}
: null} + {PRListError ? ( +
{PRListError}
+ ) : null} {!isPRListLoading && dataPRList && } diff --git a/website/src/pages/PublicRoute.tsx b/website/src/pages/PublicRoute.tsx index aca2d38f1..9b999cf20 100644 --- a/website/src/pages/PublicRoute.tsx +++ b/website/src/pages/PublicRoute.tsx @@ -43,7 +43,10 @@ const PublicRoute = () => { } /> } /> } /> - } /> + } + /> } /> } /> } /> diff --git a/website/src/pages/SearchPage/SearchPage.tsx b/website/src/pages/SearchPage/SearchPage.tsx index 492f53e52..3e41c56b2 100644 --- a/website/src/pages/SearchPage/SearchPage.tsx +++ b/website/src/pages/SearchPage/SearchPage.tsx @@ -42,7 +42,9 @@ export default function SearchPage() { <> - {searchError &&
{searchError}
} + {searchError && ( +
{searchError}
+ )} {isSearchLoading && (
@@ -55,14 +57,17 @@ export default function SearchPage() {
{dataSearch.Macros && typeof dataSearch.Macros === "object" && - Object.entries(dataSearch.Macros).map(function ( - searchMacro, - index - ) { - return ( - - ); - })} + Object.entries(dataSearch.Macros).map( + function (searchMacro, index) { + return ( + + ); + }, + )}
)} diff --git a/website/src/pages/SearchPage/components/SearchMacro.tsx b/website/src/pages/SearchPage/components/SearchMacro.tsx index 3631fdc5a..3e0c9e791 100644 --- a/website/src/pages/SearchPage/components/SearchMacro.tsx +++ b/website/src/pages/SearchPage/components/SearchMacro.tsx @@ -18,7 +18,7 @@ import React from "react"; import { formatByte, secondToMicrosecond } from "../../../utils/Utils"; import { Link } from "react-router-dom"; -import {getRange} from "@/common/Macrobench"; +import { getRange } from "@/common/Macrobench"; import PropTypes from "prop-types"; interface SearchMacroProps { @@ -54,40 +54,19 @@ export default function SearchMacro({ data, gitRef }: SearchMacroProps) {
{item} diff --git a/website/tailwind.config.ts b/website/tailwind.config.ts index 5d150e521..aedb07f24 100644 --- a/website/tailwind.config.ts +++ b/website/tailwind.config.ts @@ -81,8 +81,8 @@ const config = { }, screens: { mobile: { max: "780px" }, - midscreen: { max: "1280px"}, - widescreen: { min: "1280px" }, + midscreen: { max: "1536px"}, + widescreen: { min: "1536px" }, }, transitionDuration: { inherit: "inherit", From 8819e6594ed583b53fda91455c3a9b418f211711 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Fri, 26 Apr 2024 18:54:15 +0530 Subject: [PATCH 06/20] replacing twitter logo --- website/src/common/Footer.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/website/src/common/Footer.tsx b/website/src/common/Footer.tsx index 349c6b603..c26567568 100644 --- a/website/src/common/Footer.tsx +++ b/website/src/common/Footer.tsx @@ -16,11 +16,8 @@ limitations under the License. import React from "react"; -import { - AiFillGithub, - AiFillSlackCircle, - AiFillTwitterCircle, -} from "react-icons/ai"; +import { AiFillGithub, AiFillSlackCircle } from "react-icons/ai"; +import { FaSquareXTwitter } from "react-icons/fa6"; import { BsStackOverflow } from "react-icons/bs"; import { Link } from "react-router-dom"; @@ -28,7 +25,7 @@ const Footer = () => { const socials = [ { url: "https://github.com/vitessio/arewefastyet", icon: AiFillGithub }, { url: "https://vitess.io/slack", icon: AiFillSlackCircle }, - { url: "https://twitter.com/vitessio", icon: AiFillTwitterCircle }, + { url: "https://twitter.com/vitessio", icon: FaSquareXTwitter }, { url: "https://stackoverflow.com/search?q=vitess", icon: BsStackOverflow }, ]; From fdc1bdf0c3b4565b2c6dec89c18d560c0d3bda4c Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Sat, 27 Apr 2024 17:56:10 +0530 Subject: [PATCH 07/20] adding types in SearchPage components --- .../src/pages/SearchPage/components/Hero.tsx | 6 ++++- .../SearchPage/components/SearchMacro.tsx | 24 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/website/src/pages/SearchPage/components/Hero.tsx b/website/src/pages/SearchPage/components/Hero.tsx index 713611a4a..5d6af7727 100644 --- a/website/src/pages/SearchPage/components/Hero.tsx +++ b/website/src/pages/SearchPage/components/Hero.tsx @@ -15,7 +15,11 @@ limitations under the License. */ import React from "react"; -export default function Hero({ setGitRef }) { +interface HeroProps { + setGitRef: (value: string) => void; +} + +export default function Hero({ setGitRef }: HeroProps) { return (
diff --git a/website/src/pages/SearchPage/components/SearchMacro.tsx b/website/src/pages/SearchPage/components/SearchMacro.tsx index 685b21a1c..3631fdc5a 100644 --- a/website/src/pages/SearchPage/components/SearchMacro.tsx +++ b/website/src/pages/SearchPage/components/SearchMacro.tsx @@ -21,7 +21,25 @@ import { Link } from "react-router-dom"; import {getRange} from "@/common/Macrobench"; import PropTypes from "prop-types"; -export default function SearchMacro({ data, gitRef }) { +interface SearchMacroProps { + gitRef: string; + data: Array; +} + +interface RowProps { + title: string; + value: { + center: string | number; + range: { + infinite: boolean; + unknown: boolean; + value: number; + }; + }; + fmt?: string; +} + +export default function SearchMacro({ data, gitRef }: SearchMacroProps) { return (
@@ -112,7 +130,7 @@ export default function SearchMacro({ data, gitRef }) { ); } -function Row({ title, value, fmt }) { +function Row({ title, value, fmt }:RowProps) { var valFmt = value.center if (fmt == "time") { valFmt = secondToMicrosecond(value.center) @@ -143,4 +161,4 @@ Row.propTypes = { }), }).isRequired, fmt: PropTypes.oneOf(['time', 'memory']), -}; \ No newline at end of file +}; From b3a5a5642e9824f43c7275bf11b868c6a8aaadf1 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Fri, 26 Apr 2024 21:17:41 +0530 Subject: [PATCH 08/20] adding pr and issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 -------------- .github/ISSUE_TEMPLATE/bug_report.yml | 60 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 -------- .github/ISSUE_TEMPLATE/feature_request.yml | 37 +++++++++++++ .github/pull_request_template.md | 38 ++++++++++++++ 5 files changed, 135 insertions(+), 58 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea782..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..b51308534 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,60 @@ +name: 🐛 Bug +description: Create a report to help us improve +title: "🐛 Bug: " +labels: ["🐛 Bug", "Status: Triage"] +body: +- type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is + validations: + required: true +- type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior + placeholder: | + 1. Go to'...' + 2. Click on'...' + 3. Scroll down to'...' + 4. See error + validations: + required: true +- type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen + validations: + required: true +- type: textarea + attributes: + label: Screenshots + description: | + If applicable, add screenshots to help explain your problem + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in + validations: + required: false +- type: textarea + attributes: + label: Device Information [optional] + description: | + examples: + - **OS**: Ubuntu 20.04 + - **Browser**: chrome + - **version**: 22 + value: | + - OS: + - Browser: + - version: + render: markdown + validations: + required: false +- type: dropdown + attributes: + label: Are you working on this issue? + options: + - 'Yes' + - 'No' + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d6..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..f795639ad --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,37 @@ +name: ⭐️ Feature request +description: Suggest an idea for this project +title: "✨ Enhancement: " +labels: ["✨ Enhancement", "Status: Triage"] +body: +- type: textarea + attributes: + label: Is your feature request related to a problem? Please describe + description: A clear and concise description of what the problem is + validations: + required: true +- type: textarea + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen + validations: + required: true +- type: textarea + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered + validations: + required: false +- type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here + validations: + required: false +- type: dropdown + attributes: + label: Are you working on this? + options: + - 'Yes' + - 'No' + validations: + required: true \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..07dca7cd7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,38 @@ + + + + + +**What kind of change does this PR introduce?** + + + +**Issue Number:** + +- Closes #___ +- Related to #___ +- Others? + + +**Screenshots/videos:** + + + +| Before | After | +| ----- | ----- | +| | | + +**If relevant, did you update the documentation?** + + + +**Summary** + + + + +**Does this PR introduce a breaking change?** + + From 8024c36b51b783717bfec65abf8c253f3edc34e5 Mon Sep 17 00:00:00 2001 From: Florent Poinsard <35779988+frouioui@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:15:57 -0600 Subject: [PATCH 09/20] Update .github/ISSUE_TEMPLATE/bug_report.yml Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index b51308534..0a1909fbc 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,7 +1,7 @@ name: 🐛 Bug description: Create a report to help us improve title: "🐛 Bug: " -labels: ["🐛 Bug", "Status: Triage"] +labels: ["Type: Bug"] body: - type: textarea attributes: From 1a7a2a61c69c969ea7c80bcf95a382163f6ef97b Mon Sep 17 00:00:00 2001 From: Florent Poinsard <35779988+frouioui@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:16:01 -0600 Subject: [PATCH 10/20] Update .github/ISSUE_TEMPLATE/feature_request.yml Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index f795639ad..22c44a0c8 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,7 +1,7 @@ name: ⭐️ Feature request description: Suggest an idea for this project title: "✨ Enhancement: " -labels: ["✨ Enhancement", "Status: Triage"] +labels: ["Type: Feature Request"] body: - type: textarea attributes: From eb0081050889470de8e8f7a789ee49d3e6658ffb Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Sat, 27 Apr 2024 10:39:32 +0530 Subject: [PATCH 11/20] shifting in tailwindcss --- website/src/assets/styles/tailwind.css | 16 ++++++ website/src/pages/PublicRoute.tsx | 7 ++- website/src/utils/Error.tsx | 47 ++++++++++++++++ website/src/utils/Error/Error.tsx | 41 -------------- website/src/utils/Error/error.css | 78 -------------------------- 5 files changed, 68 insertions(+), 121 deletions(-) create mode 100644 website/src/utils/Error.tsx delete mode 100644 website/src/utils/Error/Error.tsx delete mode 100644 website/src/utils/Error/error.css diff --git a/website/src/assets/styles/tailwind.css b/website/src/assets/styles/tailwind.css index af55a32dc..a9fedf8a0 100644 --- a/website/src/assets/styles/tailwind.css +++ b/website/src/assets/styles/tailwind.css @@ -118,3 +118,19 @@ limitations under the License. @apply after:content-[counter(num)]; } } + +.errorImgAnimation { + animation: translateUpDown 2s infinite alternate; +} + +@keyframes translateUpDown { + + 0%, + 100% { + transform: translateY(0); + } + + 50% { + transform: translateY(-0.7cm); + } +} \ No newline at end of file diff --git a/website/src/pages/PublicRoute.tsx b/website/src/pages/PublicRoute.tsx index 069d5aee6..9b999cf20 100644 --- a/website/src/pages/PublicRoute.tsx +++ b/website/src/pages/PublicRoute.tsx @@ -17,7 +17,7 @@ limitations under the License. import React from "react"; import { Routes, Route } from "react-router-dom"; -import Error from "../utils/Error/Error"; +import Error from "../utils/Error"; import Layout from "../pages/Layout"; import MacroPage from "./MacroPage/MacroPage"; import ComparePage from "./ComparePage/ComparePage"; @@ -43,7 +43,10 @@ const PublicRoute = () => { } /> } /> } /> - } /> + } + /> } /> } /> } /> diff --git a/website/src/utils/Error.tsx b/website/src/utils/Error.tsx new file mode 100644 index 000000000..87ca28c3a --- /dev/null +++ b/website/src/utils/Error.tsx @@ -0,0 +1,47 @@ +/* +Copyright 2023 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React from "react"; +import { Link } from "react-router-dom"; +import ErrorImage from "../assets/error.png"; +import { Button } from "@/components/ui/button"; + +const Error = () => { + return ( +
+
+

404

+
+
+ error +
+
+

OOPS! Something went wrong

+ + + +
+
+ ); +}; + +export default Error; diff --git a/website/src/utils/Error/Error.tsx b/website/src/utils/Error/Error.tsx deleted file mode 100644 index 0a07a4553..000000000 --- a/website/src/utils/Error/Error.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2023 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import React from 'react'; -import { Link } from 'react-router-dom'; -import ErrorImage from '../../assets/error.png'; - -import '../Error/error.css' - - -const Error = () => { - return ( -
-
-

404

-
-
- error -
-
-

OOPS! Something went wrong

- -
-
- ); -}; - -export default Error; \ No newline at end of file diff --git a/website/src/utils/Error/error.css b/website/src/utils/Error/error.css deleted file mode 100644 index 3c11cb790..000000000 --- a/website/src/utils/Error/error.css +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2023 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.error { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - margin-top: 3rem; -} - -.error div { - margin: 1rem; - display: flex; - align-items: center; - flex-direction: column; -} - -.goHome { - padding: 10px 22px 10px 22px; - margin: 20px; - font-size: 1rem; - border-radius: 1rem; - background-color: #e77002; - color: white; - border: none; - cursor: pointer; - transition: 300ms ease-in; - display: flex; - flex-direction: row; - align-items: center; - column-gap: 10px; -} - -.errorImg{ - padding-left: 30px; -} -.error div img { - padding: 10px; - width: 260px; - height: 225px; - animation: translateUpDown 2s infinite alternate; -} - -.error h1 { - font-size: 3rem; - font-weight: 700; -} - -.error h2 { - font-weight: 500; - text-align: center; -} - -@keyframes translateUpDown { - - 0%, - 100% { - transform: translateY(0); - } - - 50% { - transform: translateY(-0.7cm); - } -} \ No newline at end of file From d8d7e2e17272003ade0683c22aef24ee1da10d43 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Mon, 29 Apr 2024 23:02:39 +0530 Subject: [PATCH 12/20] suggested cahnge --- website/src/pages/PublicRoute.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/website/src/pages/PublicRoute.tsx b/website/src/pages/PublicRoute.tsx index 9b999cf20..aca2d38f1 100644 --- a/website/src/pages/PublicRoute.tsx +++ b/website/src/pages/PublicRoute.tsx @@ -43,10 +43,7 @@ const PublicRoute = () => { } /> } /> } /> - } - /> + } /> } /> } /> } /> From 0fdedd0c608d4879ab793c9269cb0dd404c82ecd Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Mon, 29 Apr 2024 23:04:35 +0530 Subject: [PATCH 13/20] suggested changes --- website/src/utils/Error.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/utils/Error.tsx b/website/src/utils/Error.tsx index 87ca28c3a..dab2d76d1 100644 --- a/website/src/utils/Error.tsx +++ b/website/src/utils/Error.tsx @@ -1,5 +1,5 @@ /* -Copyright 2023 The Vitess Authors. +Copyright 2024 The Vitess Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 6d09137e04affbe32016c03d87723601fc7752ae Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Sat, 27 Apr 2024 09:33:53 +0530 Subject: [PATCH 14/20] converting into shadcn buttons --- website/src/common/Dropdown.tsx | 15 +++++++++------ .../components/QueryPlan.tsx | 6 ++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/website/src/common/Dropdown.tsx b/website/src/common/Dropdown.tsx index 158618c34..1a854c4de 100644 --- a/website/src/common/Dropdown.tsx +++ b/website/src/common/Dropdown.tsx @@ -17,6 +17,7 @@ import React, { useEffect, useRef, useState } from "react"; import useClickOutside from "../hooks/useClickOutside"; import Icon from "../common/Icon"; import { twMerge } from "tailwind-merge"; +import { Button } from "@/components/ui/button"; function Container(props) { const [open, setOpen] = useState(false); @@ -45,11 +46,12 @@ function Container(props) { }, [selectedIndex]); return ( -
- + + <>
{props.children} - + ); } diff --git a/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx b/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx index efb1a9c24..fe1f129cd 100644 --- a/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx +++ b/website/src/pages/MacroQueriesComparePage/components/QueryPlan.tsx @@ -21,6 +21,7 @@ import "react-json-pretty/themes/monikai.css"; import { twMerge } from "tailwind-merge"; import useModal from "../../../hooks/useModal"; import Icon from "../../../common/Icon"; +import { Button } from "@/components/ui/button"; export default function QueryPlan({ data }) { const modal = useModal(); @@ -76,12 +77,13 @@ function DetailsModal({ data }) { return (
- +

Statistics

From 97491c34a2f5d09df2306600be4055f8211ec536 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Mon, 29 Apr 2024 23:11:35 +0530 Subject: [PATCH 15/20] text-color fix --- website/src/common/Dropdown.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/common/Dropdown.tsx b/website/src/common/Dropdown.tsx index 1a854c4de..3d4625826 100644 --- a/website/src/common/Dropdown.tsx +++ b/website/src/common/Dropdown.tsx @@ -51,7 +51,7 @@ function Container(props) { variant="outline" onClick={() => setOpen(!open)} className={twMerge( - "flex items-center h-full justify-center duration-inherit hover:bg-transparent", + "flex text-black dark:text-white items-center h-full justify-center duration-inherit hover:bg-transparent", props.className )} > From 5f8928923b5cb40a08e63d95c9fc8981523d4b2e Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Wed, 1 May 2024 00:42:50 +0530 Subject: [PATCH 16/20] text-color fix --- website/src/common/Dropdown.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/common/Dropdown.tsx b/website/src/common/Dropdown.tsx index 3d4625826..aa757a77b 100644 --- a/website/src/common/Dropdown.tsx +++ b/website/src/common/Dropdown.tsx @@ -51,7 +51,7 @@ function Container(props) { variant="outline" onClick={() => setOpen(!open)} className={twMerge( - "flex text-black dark:text-white items-center h-full justify-center duration-inherit hover:bg-transparent", + "flex items-center h-full justify-center duration-inherit hover:bg-transparent", props.className )} > @@ -93,7 +93,7 @@ function Container(props) { function Option(props) { return ( @@ -68,7 +68,7 @@ function Container(props) { <>
{props.children} diff --git a/website/src/common/Macrobench.tsx b/website/src/common/Macrobench.tsx index ec4d39beb..fbe8e0774 100644 --- a/website/src/common/Macrobench.tsx +++ b/website/src/common/Macrobench.tsx @@ -15,10 +15,10 @@ limitations under the License. */ import React from "react"; -import PropTypes from 'prop-types'; +import PropTypes from "prop-types"; import { Link } from "react-router-dom"; import { formatByte, fixed, secondToMicrosecond } from "../utils/Utils"; -import {twMerge} from "tailwind-merge"; +import { twMerge } from "tailwind-merge"; export default function Macrobench({ data, gitRef, commits }) { return ( @@ -166,7 +166,9 @@ export default function Macrobench({ data, gitRef, commits }) { oldVal={data.result.components_cpu_time.vttablet.old} newVal={data.result.components_cpu_time.vttablet.new} delta={data.result.components_cpu_time.vttablet.delta} - insignificant={data.result.components_cpu_time.vttablet.insignificant} + insignificant={ + data.result.components_cpu_time.vttablet.insignificant + } p={fixed(data.result.components_cpu_time.vttablet.p, 3)} fmt={"time"} /> @@ -176,7 +178,9 @@ export default function Macrobench({ data, gitRef, commits }) { oldVal={data.result.total_components_mem_stats_alloc_bytes.old} newVal={data.result.total_components_mem_stats_alloc_bytes.new} delta={data.result.total_components_mem_stats_alloc_bytes.delta} - insignificant={data.result.total_components_mem_stats_alloc_bytes.insignificant} + insignificant={ + data.result.total_components_mem_stats_alloc_bytes.insignificant + } p={fixed(data.result.total_components_mem_stats_alloc_bytes.p, 3)} fmt={"memory"} /> @@ -186,7 +190,9 @@ export default function Macrobench({ data, gitRef, commits }) { oldVal={data.result.components_mem_stats_alloc_bytes.vtgate.old} newVal={data.result.components_mem_stats_alloc_bytes.vtgate.new} delta={data.result.components_mem_stats_alloc_bytes.vtgate.delta} - insignificant={data.result.components_mem_stats_alloc_bytes.vtgate.insignificant} + insignificant={ + data.result.components_mem_stats_alloc_bytes.vtgate.insignificant + } p={fixed(data.result.components_mem_stats_alloc_bytes.vtgate.p, 3)} fmt={"memory"} /> @@ -196,8 +202,14 @@ export default function Macrobench({ data, gitRef, commits }) { oldVal={data.result.components_mem_stats_alloc_bytes.vttablet.old} newVal={data.result.components_mem_stats_alloc_bytes.vttablet.new} delta={data.result.components_mem_stats_alloc_bytes.vttablet.delta} - insignificant={data.result.components_mem_stats_alloc_bytes.vttablet.insignificant} - p={fixed(data.result.components_mem_stats_alloc_bytes.vttablet.p, 3)} + insignificant={ + data.result.components_mem_stats_alloc_bytes.vttablet + .insignificant + } + p={fixed( + data.result.components_mem_stats_alloc_bytes.vttablet.p, + 3, + )} fmt={"memory"} /> @@ -208,32 +220,35 @@ export default function Macrobench({ data, gitRef, commits }) { export function getRange(range) { if (range.infinite == true) { - return "∞" + return "∞"; } if (range.unknown == true) { - return "?" + return "?"; } - return "±"+fixed(range.value, 1)+"%" + return "±" + fixed(range.value, 1) + "%"; } function Row({ title, oldVal, newVal, delta, insignificant, p, fmt }) { - let status = + "text-lg text-white px-4 rounded-full", + insignificant == true && "bg-[#dd1a2a]", + insignificant == false && "bg-[#00aa00]", + )} + > {insignificant == true ? "No" : "Yes"} - + + ); - var oldValFmt = oldVal.center - var newValFmt = newVal.center + var oldValFmt = oldVal.center; + var newValFmt = newVal.center; if (fmt == "time") { - oldValFmt = secondToMicrosecond(oldVal.center) - newValFmt = secondToMicrosecond(newVal.center) + oldValFmt = secondToMicrosecond(oldVal.center); + newValFmt = secondToMicrosecond(newVal.center); } else if (fmt == "memory") { - oldValFmt = formatByte(oldVal.center) - newValFmt = formatByte(newVal.center) + oldValFmt = formatByte(oldVal.center); + newValFmt = formatByte(newVal.center); } return ( @@ -242,10 +257,14 @@ function Row({ title, oldVal, newVal, delta, insignificant, p, fmt }) { {title}
- {oldValFmt} ({getRange(oldVal.range)}) + + {oldValFmt} ({getRange(oldVal.range)}) + - {newValFmt} ({getRange(newVal.range)}) + + {newValFmt} ({getRange(newVal.range)}) + {p || "?"} @@ -253,9 +272,7 @@ function Row({ title, oldVal, newVal, delta, insignificant, p, fmt }) { {fixed(delta, 3) || 0}% - {status} - {status}
{title} - {fmtString(val, fmt)} ({getRange(val.range)}) + + {fmtString(val, fmt)} ({getRange(val.range)}) +
- + - + - + - + - + - + - + - ); + ); } Row.propTypes = { - title: PropTypes.string.isRequired, - value: PropTypes.shape({ - center: PropTypes.number.isRequired, - range: PropTypes.shape({ - infinite: PropTypes.bool.isRequired, - unknown: PropTypes.bool.isRequired, - value: PropTypes.number.isRequired, - }), - }).isRequired, - fmt: PropTypes.oneOf(['time', 'memory']), + title: PropTypes.string.isRequired, + value: PropTypes.shape({ + center: PropTypes.number.isRequired, + range: PropTypes.shape({ + infinite: PropTypes.bool.isRequired, + unknown: PropTypes.bool.isRequired, + value: PropTypes.number.isRequired, + }), + }).isRequired, + fmt: PropTypes.oneOf(["time", "memory"]), }; diff --git a/website/src/pages/StatusPage/StatusPage.tsx b/website/src/pages/StatusPage/StatusPage.tsx index 35842831a..f23a3a59b 100644 --- a/website/src/pages/StatusPage/StatusPage.tsx +++ b/website/src/pages/StatusPage/StatusPage.tsx @@ -29,7 +29,7 @@ export default function StatusPage() { error: errorQueue, } = useApiCall(`${import.meta.env.VITE_API_URL}queue`); const { data: dataPreviousExe, isLoading: isLoadingPreviousExe } = useApiCall( - `${import.meta.env.VITE_API_URL}recent` + `${import.meta.env.VITE_API_URL}recent`, ); return ( diff --git a/website/src/pages/StatusPage/components/Hero.tsx b/website/src/pages/StatusPage/components/Hero.tsx index 286b5ad31..4bb436edb 100644 --- a/website/src/pages/StatusPage/components/Hero.tsx +++ b/website/src/pages/StatusPage/components/Hero.tsx @@ -24,7 +24,7 @@ const info = [ export default function Hero() { const { data: dataStatusStats } = useApiCall( - `${import.meta.env.VITE_API_URL}status/stats` + `${import.meta.env.VITE_API_URL}status/stats`, ); return ( diff --git a/website/src/pages/StatusPage/components/PreviousExecutions.tsx b/website/src/pages/StatusPage/components/PreviousExecutions.tsx index 7ab9d19bb..099698a14 100644 --- a/website/src/pages/StatusPage/components/PreviousExecutions.tsx +++ b/website/src/pages/StatusPage/components/PreviousExecutions.tsx @@ -72,7 +72,7 @@ export default function PreviousExecutions(props) { "text-lg text-white px-4 rounded-full", entry.status === "failed" && "bg-[#dd1a2a]", entry.status === "finished" && "bg-[#00aa00]", - entry.status === "started" && "bg-[#3a3aed]" + entry.status === "started" && "bg-[#3a3aed]", )} > {entry.status} diff --git a/website/src/utils/Utils.tsx b/website/src/utils/Utils.tsx index 4a01fb410..3fb7d3036 100644 --- a/website/src/utils/Utils.tsx +++ b/website/src/utils/Utils.tsx @@ -83,7 +83,7 @@ export const valueDropDown = ( setDropDown, setCommitHash, setOpenDropDown, - setChangeUrl + setChangeUrl, ) => { setDropDown(ref.Name); setCommitHash(ref.CommitHash); diff --git a/website/tailwind.config.ts b/website/tailwind.config.ts index aedb07f24..4199df9dc 100644 --- a/website/tailwind.config.ts +++ b/website/tailwind.config.ts @@ -1,13 +1,13 @@ -import type { Config } from "tailwindcss" +import type { Config } from "tailwindcss"; const config = { darkMode: ["class"], content: [ - './pages/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}', - './app/**/*.{ts,tsx}', - './src/**/*.{ts,tsx}', - ], + "./pages/**/*.{ts,tsx}", + "./components/**/*.{ts,tsx}", + "./app/**/*.{ts,tsx}", + "./src/**/*.{ts,tsx}", + ], prefix: "", theme: { container: { @@ -81,7 +81,7 @@ const config = { }, screens: { mobile: { max: "780px" }, - midscreen: { max: "1536px"}, + midscreen: { max: "1536px" }, widescreen: { min: "1536px" }, }, transitionDuration: { @@ -93,6 +93,6 @@ const config = { }, }, plugins: [require("tailwindcss-animate")], -} satisfies Config +} satisfies Config; -export default config \ No newline at end of file +export default config; From f8e31b04b889717a829c8d5cca29e7a5ff4a6f32 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Thu, 9 May 2024 01:29:07 +0530 Subject: [PATCH 18/20] workdir --- .github/workflows/typescript_lint.yaml | 52 +++----------------------- 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/.github/workflows/typescript_lint.yaml b/.github/workflows/typescript_lint.yaml index a36d4fdfd..7588e7a69 100644 --- a/.github/workflows/typescript_lint.yaml +++ b/.github/workflows/typescript_lint.yaml @@ -1,4 +1,5 @@ name: PR Workflow + on: pull_request: types: [opened, reopened, synchronize] @@ -13,24 +14,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: cd website && echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - - name: Cache Node dependencies - uses: actions/cache@v4 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: yarn list - - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -38,9 +21,12 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile + working-directory: website + - name: Linting and Formatting checks run: yarn run lint + working-directory: website - name: Type checking run: yarn run typecheck @@ -55,34 +41,6 @@ jobs: with: submodules: recursive - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - - name: Cache Node dependencies - uses: actions/cache@v4 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: yarn list - - - name: Cache Next Build - uses: actions/cache@v4 - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ${{ github.workspace }}/.next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}- - - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -93,3 +51,5 @@ jobs: - name: Build run: yarn run build + + # Additional steps for the build job... From cea9c68d054f07f3bd37fda21c0b5cb9877e7a2d Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Thu, 9 May 2024 01:39:16 +0530 Subject: [PATCH 19/20] parent f8e31b04b889717a829c8d5cca29e7a5ff4a6f32 author Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> 1715198956 +0530 committer Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> 1716135857 +0530 fix adding format script and updating readme updating readme work dir fix work dir fix fix workdir removing commit --- .github/workflows/typescript_lint.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/typescript_lint.yaml b/.github/workflows/typescript_lint.yaml index 7588e7a69..c9ff83ec7 100644 --- a/.github/workflows/typescript_lint.yaml +++ b/.github/workflows/typescript_lint.yaml @@ -16,7 +16,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 - with: + with: node-version: 20 - name: Install dependencies @@ -50,6 +50,4 @@ jobs: run: yarn install --frozen-lockfile - name: Build - run: yarn run build - - # Additional steps for the build job... + run: yarn run build \ No newline at end of file From 34d4c23342e966d05009bf80760ca5f15730f2de Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Thu, 9 May 2024 23:56:26 +0530 Subject: [PATCH 20/20] Re:workflow name --- .github/workflows/typescript_lint.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/typescript_lint.yaml b/.github/workflows/typescript_lint.yaml index c9ff83ec7..cb81beb1a 100644 --- a/.github/workflows/typescript_lint.yaml +++ b/.github/workflows/typescript_lint.yaml @@ -1,4 +1,4 @@ -name: PR Workflow +name: Typescript Lint, Format and Type check workflow on: pull_request: @@ -8,7 +8,7 @@ on: jobs: linting_and_type-checking: - name: Linting, Formatting and Type checking + name: Typescript Linting, Formatting and Type checking runs-on: ubuntu-latest steps: - name: Checkout repository @@ -23,7 +23,6 @@ jobs: run: yarn install --frozen-lockfile working-directory: website - - name: Linting and Formatting checks run: yarn run lint working-directory: website @@ -50,4 +49,4 @@ jobs: run: yarn install --frozen-lockfile - name: Build - run: yarn run build \ No newline at end of file + run: yarn run build
{title} - {valFmt} ({getRange(value.range)}) + + {valFmt} ({getRange(value.range)}) +