diff --git a/.github/workflows/cd.deploy.yml b/.github/workflows/cd.deploy.yml index 3dd65d6d..e63cdd09 100644 --- a/.github/workflows/cd.deploy.yml +++ b/.github/workflows/cd.deploy.yml @@ -12,7 +12,7 @@ jobs: node-version: "20" os: "ubuntu-latest" - bundle-deploy: + docker-build-push-api: needs: build runs-on: ubuntu-latest env: diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..aaaaf37b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "singleQuote": false, + "printWidth": 100, + "trailingComma": "all", + "endOfLine": "auto", + "todo-zm": "remove packages/tooling/.prettierrc" +} diff --git a/README.md b/README.md index 6a521a84..6a5e3d40 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ npm run dev:all Please check the README.md files inside `./api` and `./web` for more info. + + ## Contributing To get started, see [the contributing guidelines](https://github.com/dzcode-io/dzcode.io/blob/main/.github/CONTRIBUTING.md). @@ -69,8 +71,6 @@ If you use VSCode, please make sure to have a `.vscode/settings.json` file with "files.associations": { "*.css": "tailwindcss" }, - "prettier.configPath": "packages/tooling/.prettierrc", - "prettier.prettierPath": "./node_modules/prettier/index.cjs", "eslint.options": { "overrideConfigFile": "packages/tooling/eslint.config.mjs" }, "editor.codeActionsOnSave": { "source.fixAll.eslint": "always", diff --git a/api/src/digest/cron.ts b/api/src/digest/cron.ts index 0a4110d1..a57aa7dd 100644 --- a/api/src/digest/cron.ts +++ b/api/src/digest/cron.ts @@ -142,11 +142,6 @@ it may contain non-translatable parts like acronyms, keep them as is.`; name_ar, }; const [{ id: projectId }] = await this.projectsRepository.upsert(projectEntity); - for (const tagId of project.tags || []) { - await this.tagRepository.upsert({ id: tagId, runId }); - await this.projectsRepository.upsertRelationWithTag({ projectId, tagId, runId }); - } - await this.searchService.upsert("project", projectEntity); let addedRepositoryCount = 0; try { @@ -294,8 +289,19 @@ it may contain non-translatable parts like acronyms, keep them as is.`; if (addedRepositoryCount === 0) { captureException(new Error("Empty project"), { extra: { project } }); await this.projectsRepository.deleteRelationWithTagByProjectId(projectId); - await this.projectsRepository.deleteById(projectId); + await this.projectsRepository.upsert({ ...projectEntity, runId: "garbage-collected" }); + continue; + } + + for (const tagId of project.tags || []) { + await this.tagRepository.upsert({ id: tagId, runId }); + await this.projectsRepository.upsertRelationWithTag({ + projectId, + tagId, + runId, + }); } + await this.searchService.upsert("project", projectEntity); } try { diff --git a/api/src/fetch/service.ts b/api/src/fetch/service.ts index e757cdfe..c3de752f 100644 --- a/api/src/fetch/service.ts +++ b/api/src/fetch/service.ts @@ -48,6 +48,10 @@ export class FetchService { private async fetch(url: string, options: FetchOptions) { this.logger.info({ message: `Fetching ${url}` }); const response = await this.makeFetchHappenInstance(url, options); + if (!response.ok) { + this.logger.error({ message: `Failed to fetch ${url}`, meta: { status: response.status } }); + throw new Error(`Failed to fetch ${url}: ${response.statusText}`); + } const jsonResponse = (await response.json()) as T; return jsonResponse; } diff --git a/data/models/projects/SPL_Router/info.json b/data/models/projects/SPL_Router/info.json index 667a29e7..848eb455 100644 --- a/data/models/projects/SPL_Router/info.json +++ b/data/models/projects/SPL_Router/info.json @@ -4,7 +4,8 @@ { "provider": "github", "owner": "Mouhamedtec", - "repository": "SPL-Router" + "name": "SPL-Router" } - ] + ], + "tags": ["by-algerian"] }