From e3675470dcc0acb9cd2a978f01144240bf452b71 Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Thu, 1 Feb 2024 15:47:23 -0600 Subject: [PATCH 1/2] fix: fetch insight and insight repositories in parallel (#79) --- src/github/entities/db-insight.entity.ts | 2 +- .../insight-card/insight-card.service.ts | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/github/entities/db-insight.entity.ts b/src/github/entities/db-insight.entity.ts index 98a3080..488e199 100644 --- a/src/github/entities/db-insight.entity.ts +++ b/src/github/entities/db-insight.entity.ts @@ -10,7 +10,7 @@ export interface DbInsight { repos: DbUserInsightRepo[]; } -interface DbUserInsightRepo { +export interface DbUserInsightRepo { readonly id: number; readonly insight_id: number; readonly repo_id: number; diff --git a/src/social-card/insight-card/insight-card.service.ts b/src/social-card/insight-card/insight-card.service.ts index 86afafb..d8c73ee 100644 --- a/src/social-card/insight-card/insight-card.service.ts +++ b/src/social-card/insight-card/insight-card.service.ts @@ -9,7 +9,7 @@ import tailwindConfig from "../templates/tailwind.config"; import { firstValueFrom } from "rxjs"; import { RequiresUpdateMeta } from "../user-card/user-card.service"; -import { DbInsight } from "../../github/entities/db-insight.entity"; +import { DbInsight, DbUserInsightRepo } from "../../github/entities/db-insight.entity"; import insightCardTemplate from "../templates/insight-card.template"; import insightRepos from "../templates/shared/insight-repos"; import insightContributors from "../templates/shared/insight-contributors"; @@ -34,12 +34,16 @@ export class InsightCardService { private async getInsightData (insightId: number): Promise { const maxRepoQueryIdsLenght = 10; - const insightPageReq = await firstValueFrom( - this.httpService.get(`${process.env.API_BASE_URL!}/v2/insights/${insightId}`), + const insightPageApiReq = firstValueFrom( + this.httpService.get(`${process.env.API_BASE_URL!}/v2/insights/${insightId}?include=none`), ); + const insightReposApiReq = firstValueFrom( + this.httpService.get(`${process.env.API_BASE_URL!}/v2/insights/${insightId}/repos`), + ); + const [insightPageReq, insightReposReq] = await Promise.all([insightPageApiReq, insightReposApiReq]); - const { repos, name, updated_at } = insightPageReq.data; - + const { name, updated_at } = insightPageReq.data; + const { data: repos } = insightReposReq; const query = (new URLSearchParams); query.set( From 9a8cfc4ec5f1da650ce69997b800f749d5a54fef Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Thu, 1 Feb 2024 21:50:35 +0000 Subject: [PATCH 2/2] chore(patch): release 2.5.1-beta.1 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### [2.5.1-beta.1](https://github.com/open-sauced/opengraph.opensauced.pizza/compare/v2.5.0...v2.5.1-beta.1) (2024-02-01) ### 🐛 Bug Fixes * fetch insight and insight repositories in parallel ([#79](https://github.com/open-sauced/opengraph.opensauced.pizza/issues/79)) ([e367547](https://github.com/open-sauced/opengraph.opensauced.pizza/commit/e3675470dcc0acb9cd2a978f01144240bf452b71)) --- CHANGELOG.md | 7 +++++++ npm-shrinkwrap.json | 4 ++-- package.json | 2 +- public/diagram.svg | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8094d65..b629d38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ > All notable changes to this project will be documented in this file +### [2.5.1-beta.1](https://github.com/open-sauced/opengraph.opensauced.pizza/compare/v2.5.0...v2.5.1-beta.1) (2024-02-01) + + +### 🐛 Bug Fixes + +* fetch insight and insight repositories in parallel ([#79](https://github.com/open-sauced/opengraph.opensauced.pizza/issues/79)) ([e367547](https://github.com/open-sauced/opengraph.opensauced.pizza/commit/e3675470dcc0acb9cd2a978f01144240bf452b71)) + ## [2.5.0](https://github.com/open-sauced/opengraph.opensauced.pizza/compare/v2.4.1...v2.5.0) (2024-01-30) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1f21015..172d440 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "@open-sauced/opengraph.opensauced.pizza", - "version": "2.5.0", + "version": "2.5.1-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@open-sauced/opengraph.opensauced.pizza", - "version": "2.5.0", + "version": "2.5.1-beta.1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 883461c..b8f55ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@open-sauced/opengraph.opensauced.pizza", - "version": "2.5.0", + "version": "2.5.1-beta.1", "keywords": [], "description": "OpenGraph dot Open Sauced is a general purpose social card generator", "author": "Ahmed Mohamed Atwa ", diff --git a/public/diagram.svg b/public/diagram.svg index de6f395..408e35b 100644 --- a/public/diagram.svg +++ b/public/diagram.svg @@ -1 +1 @@ -social-cardsocial-cards3-file-storages3-file-storagehealthhealthgithubgithubconfigconfiguser-carduser-cardtemplatestemplatesinsight-cardinsight-cardhighlight-cardhighlight-cardgqlgqlentitiesentitiessharedshareds3-file-storag...s3-file-storag...s3-file-storag...health.contro...health.contro...health.contro...github.serv...github.serv...github.serv...api.confi...api.confi...api.confi...digital-...digital-...digital-...main.tsmain.tsmain.tsutils/twemoji.tsutils/twemoji.tsutils/twemoji.tsapp.module.tsapp.module.tsapp.module.tsuser-card.service.tsuser-card.service.tsuser-card.service.tsuser-card.cont...user-card.cont...user-card.cont...tailwind.config.tstailwind.config.tstailwind.config.tshighlight-...highlight-...highlight-...user-prof...user-prof...user-prof...insight-...insight-...insight-...insight-card.servic...insight-card.servic...insight-card.servic...insight-card.c...insight-card.c...insight-card.c...highlight-card.servic...highlight-card.servic...highlight-card.servic...highlight-card...highlight-card...highlight-card...get-user.tsget-user.tsget-user.tscard-footer.tscard-footer.tscard-footer.tsuser-rep...user-rep...user-rep...insight-...insight-...insight-...insight-...insight-...insight-....gql.tseach dot sized by file size \ No newline at end of file +social-cardsocial-cards3-file-storages3-file-storagehealthhealthgithubgithubconfigconfiguser-carduser-cardtemplatestemplatesinsight-cardinsight-cardhighlight-cardhighlight-cardgqlgqlentitiesentitiessharedshareds3-file-storag...s3-file-storag...s3-file-storag...health.contro...health.contro...health.contro...github.serv...github.serv...github.serv...api.confi...api.confi...api.confi...digital-...digital-...digital-...main.tsmain.tsmain.tsutils/twemoji.tsutils/twemoji.tsutils/twemoji.tsapp.module.tsapp.module.tsapp.module.tsuser-card.service.tsuser-card.service.tsuser-card.service.tsuser-card.cont...user-card.cont...user-card.cont...tailwind.config.tstailwind.config.tstailwind.config.tshighlight-...highlight-...highlight-...user-prof...user-prof...user-prof...insight-...insight-...insight-...insight-card.servic...insight-card.servic...insight-card.servic...insight-card.c...insight-card.c...insight-card.c...highlight-card.servi...highlight-card.servi...highlight-card.servi...highlight-card...highlight-card...highlight-card...get-user.tsget-user.tsget-user.tscard-footer.tscard-footer.tscard-footer.tsuser-rep...user-rep...user-rep...insight-...insight-...insight-...insight-...insight-...insight-....gql.tseach dot sized by file size \ No newline at end of file