Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
node-version: "20"
os: "ubuntu-latest"

bundle-deploy:
docker-build-push-api:
needs: build
runs-on: ubuntu-latest
env:
Expand Down
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": false,
"printWidth": 100,
"trailingComma": "all",
"endOfLine": "auto",
"todo-zm": "remove packages/tooling/.prettierrc"
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ npm run dev:all

Please check the README.md files inside `./api` and `./web` for more info.

<!--todo-zm: move this to CONTRIBUTING.md-->

## Contributing

To get started, see [the contributing guidelines](https://github.com/dzcode-io/dzcode.io/blob/main/.github/CONTRIBUTING.md).
Expand All @@ -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",
Expand Down
18 changes: 12 additions & 6 deletions api/src/digest/cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions api/src/fetch/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export class FetchService {
private async fetch<T>(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;
}
Expand Down
5 changes: 3 additions & 2 deletions data/models/projects/SPL_Router/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{
"provider": "github",
"owner": "Mouhamedtec",
"repository": "SPL-Router"
"name": "SPL-Router"
}
]
],
"tags": ["by-algerian"]
}
Loading