Skip to content

Commit

Permalink
#174 : remove unused field
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermau committed Mar 7, 2025
1 parent 613abbb commit fafa560
Show file tree
Hide file tree
Showing 25 changed files with 42 additions and 125 deletions.
1 change: 0 additions & 1 deletion api/scripts/load-git-repo-in-pg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const insertSoftwares = async (
dereferencing: row.dereferencing ? JSON.stringify(row.dereferencing) : null,
softwareType: JSON.stringify(row.softwareType),
workshopUrls: JSON.stringify(row.workshopUrls),
testUrls: JSON.stringify(row.testUrls),
categories: JSON.stringify(row.categories),
keywords: JSON.stringify(row.keywords)
}))
Expand Down
4 changes: 0 additions & 4 deletions api/src/core/adapters/compileData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,8 @@ export function createCompileData(params: {
comptoirDuLibreId,
license,
softwareType,
catalogNumeriqueGouvFrId,
versionMin,
workshopUrls,
testUrls,
categories,
generalInfoMd,
addedByAgentEmail,
Expand All @@ -293,10 +291,8 @@ export function createCompileData(params: {
isPresentInSupportContract,
license,
softwareType,
catalogNumeriqueGouvFrId,
versionMin,
workshopUrls,
testUrls,
categories,
generalInfoMd,
addedByAgentEmail,
Expand Down
2 changes: 0 additions & 2 deletions api/src/core/adapters/dbApi/kysely/createGetCompiledData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const createGetCompiledData = (db: Kysely<Database>) => async (): Promise
.select([
"s.id",
"s.addedByAgentId",
"s.catalogNumeriqueGouvFrId",
"s.categories",
"s.dereferencing",
"s.description",
Expand All @@ -54,7 +53,6 @@ export const createGetCompiledData = (db: Kysely<Database>) => async (): Promise
"s.name",
"s.referencedSinceTime",
"s.softwareType",
"s.testUrls",
"s.updateTime",
"s.versionMin",
"s.workshopUrls",
Expand Down
11 changes: 0 additions & 11 deletions api/src/core/adapters/dbApi/kysely/createPgSoftwareRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi
externalDataOrigin: externalDataOrigin,
comptoirDuLibreId: comptoirDuLibreId,
softwareType: JSON.stringify(softwareType),
catalogNumeriqueGouvFrId: undefined,
workshopUrls: JSON.stringify([]),
testUrls: JSON.stringify([]),
categories: JSON.stringify([]),
generalInfoMd: undefined,
addedByAgentId: agentId,
Expand Down Expand Up @@ -141,9 +139,7 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi
externalId: externalId,
comptoirDuLibreId: comptoirDuLibreId,
softwareType: JSON.stringify(softwareType),
catalogNumeriqueGouvFrId: undefined,
workshopUrls: JSON.stringify([]),
testUrls: JSON.stringify([]),
categories: JSON.stringify([]),
generalInfoMd: undefined,
addedByAgentId: agentId,
Expand All @@ -159,7 +155,6 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi
.then((result): Software | undefined => {
if (!result) return;
const {
testUrls,
serviceProviders,
parentExternalData,
updateTime,
Expand Down Expand Up @@ -189,7 +184,6 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi
software.comptoirDuLibreSoftware?.external_resources.repository,
documentationUrl: softwareExternalData?.documentationUrl,
comptoirDuLibreServiceProviderCount: software.comptoirDuLibreSoftware?.providers.length ?? 0,
testUrl: testUrls[0]?.url,
parentWikidataSoftware: parentExternalData,
keywords: software?.keywords ?? softwareExternalData?.keywords ?? [],
programmingLanguages: softwareExternalData?.programmingLanguages ?? [],
Expand Down Expand Up @@ -245,7 +239,6 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi

return softwares.map(
({
testUrls,
serviceProviders,
parentExternalData,
updateTime,
Expand Down Expand Up @@ -292,7 +285,6 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi
documentationUrl: softwareExternalData?.documentationUrl ?? undefined,
comptoirDuLibreServiceProviderCount:
software.comptoirDuLibreSoftware?.providers.length ?? 0,
testUrl: testUrls[0]?.url,
parentWikidataSoftware: parentExternalData ?? undefined,
applicationCategories: software.categories.concat(
softwareExternalData?.applicationCategories ?? []
Expand Down Expand Up @@ -385,7 +377,6 @@ const makeGetSoftwareBuilder = (db: Kysely<Database>) =>
"s.description as softwareDescription",
"cs.serviceProviders",
"cs.latestVersion",
"s.testUrls",
"s.referencedSinceTime as addedTime",
"s.updateTime",
"s.lastExtraDataFetchAt",
Expand Down Expand Up @@ -538,7 +529,6 @@ const makeGetSoftwareById =
.then((result): Software | undefined => {
if (!result) return;
const {
testUrls,
serviceProviders,
parentExternalData,
updateTime,
Expand Down Expand Up @@ -568,7 +558,6 @@ const makeGetSoftwareById =
software.comptoirDuLibreSoftware?.external_resources.repository,
documentationUrl: softwareExternalData?.documentationUrl,
comptoirDuLibreServiceProviderCount: software.comptoirDuLibreSoftware?.providers.length ?? 0,
testUrl: testUrls[0]?.url,
parentWikidataSoftware: parentExternalData,
programmingLanguages: softwareExternalData?.programmingLanguages ?? [],
referencePublications: softwareExternalData?.referencePublications,
Expand Down
7 changes: 0 additions & 7 deletions api/src/core/adapters/dbApi/kysely/kysely.database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,8 @@ type SoftwaresTable = {
comptoirDuLibreId: number | null;
license: string;
softwareType: JSONColumnType<SoftwareType>;
catalogNumeriqueGouvFrId: string | null;
versionMin: string | null;
workshopUrls: JSONColumnType<string[]>;
testUrls: JSONColumnType<
{
description: string;
url: string;
}[]
>;
categories: JSONColumnType<string[]>;
generalInfoMd: string | null;
addedByAgentId: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Kysely } from "kysely";

export async function up(db: Kysely<any>): Promise<void> {
await db.schema.alterTable("softwares").dropColumn("catalogNumeriqueGouvFrId").dropColumn("testUrls").execute();
}

export async function down(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable("softwares")
.addColumn("testUrls", "jsonb")
.addColumn("catalogNumeriqueGouvFrId", "text")
.execute();
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ describe("pgDbApi", () => {
},
type: "desktop/mobile"
},
testUrl: undefined,
userAndReferentCountByOrganization: {
[insertedAgent.organization]: {
userCount: 1,
Expand Down
10 changes: 4 additions & 6 deletions api/src/core/adapters/fetchExternalData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ const insertApacheWithCorrectId = async (db: Kysely<Database>, agentId: number)
"comptoirDuLibreId", name, description, license, "versionMin",
"isPresentInSupportContract", "isFromFrenchPublicService", "logoUrl",
keywords, "doRespectRgaa", "isStillInObservation",
"parentSoftwareWikidataId", "catalogNumeriqueGouvFrId", "workshopUrls",
"testUrls", categories, "generalInfoMd", "addedByAgentId",
"parentSoftwareWikidataId", "workshopUrls", categories, "generalInfoMd", "addedByAgentId",
dereferencing, "referencedSinceTime", "updateTime")
VALUES (${apacheSoftwareId},
'{"os": {"ios": false, "mac": false, "linux": true, "android": false, "windows": false}, "type": "desktop/mobile"}',
'Q11354', 'wikidata', 3737, 'Apache HTTP Server',
'Serveur Web & Reverse Proxy', 'Apache-2.0', '212', true, false,
'https://sill.code.gouv.fr/logo/apache-http.png',
'["serveur", "http", "web", "server", "apache"]', false, false,
null, null, '[]', '[]', '[]', null, ${agentId}, null,
null, '[]', '[]', null, ${agentId}, null,
1728462232094,
1728462232094);
`.execute(db);
Expand All @@ -66,8 +65,7 @@ const insertAcceleroWithCorrectId = async (db: Kysely<Database>, agentId: number
keywords, "doRespectRgaa",
"isStillInObservation",
"parentSoftwareWikidataId",
"catalogNumeriqueGouvFrId",
"workshopUrls", "testUrls", categories,
"workshopUrls", categories,
"generalInfoMd", "addedByAgentId",
dereferencing, "referencedSinceTime",
"updateTime")
Expand All @@ -76,7 +74,7 @@ const insertAcceleroWithCorrectId = async (db: Kysely<Database>, agentId: number
'Outil et/ou plugin de génération de tout ou partie du code',
'EPL-2.0', '3.7.8', false, false, null,
'["modélisation", "génération", "code", "modeling", "code generation"]',
false, false, null, null, '[]', '[]',
false, false, null, '[]',
'["Other Development Tools"]', null, ${agentId}, null,
1514764800000,
1514764800000);
Expand Down
6 changes: 0 additions & 6 deletions api/src/core/ports/CompileData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ export namespace CompiledData {
| "isPresentInSupportContract"
| "license"
| "softwareType"
| "catalogNumeriqueGouvFrId"
| "versionMin"
| "workshopUrls"
| "testUrls"
| "categories"
| "generalInfoMd"
| "logoUrl"
Expand Down Expand Up @@ -112,7 +110,6 @@ export function compiledDataPrivateToPublic(compiledData: CompiledData<"private"
users,
instances,
annuaireCnllServiceProviders,
catalogNumeriqueGouvFrId,
categories,
comptoirDuLibreSoftware,
dereferencing,
Expand All @@ -129,7 +126,6 @@ export function compiledDataPrivateToPublic(compiledData: CompiledData<"private"
name,
referencedSinceTime,
softwareType,
testUrls,
latestVersion,
updateTime,
versionMin,
Expand All @@ -143,7 +139,6 @@ export function compiledDataPrivateToPublic(compiledData: CompiledData<"private"
return {
serviceProviders,
annuaireCnllServiceProviders,
catalogNumeriqueGouvFrId,
categories,
comptoirDuLibreSoftware,
dereferencing,
Expand All @@ -160,7 +155,6 @@ export function compiledDataPrivateToPublic(compiledData: CompiledData<"private"
name,
referencedSinceTime,
softwareType,
testUrls,
latestVersion,
updateTime,
versionMin,
Expand Down
5 changes: 0 additions & 5 deletions api/src/core/ports/DbApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@ export namespace Db {
softwareType: SoftwareType;
//Lien vers catalogue.numerique.gouv.fr
/* cspell: disable-next-line */
catalogNumeriqueGouvFrId: string | undefined;
versionMin: string | undefined;
workshopUrls: string[];
testUrls: {
description: string;
url: string;
}[];
categories: string[];
generalInfoMd: string | undefined;
addedByAgentEmail: string;
Expand Down
1 change: 0 additions & 1 deletion api/src/core/usecases/readWriteSillData/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export type Software = {
publicationTime?: number;
}
| undefined;
testUrl: string | undefined;
addedTime: number;
updateTime: number;
dereferencing:
Expand Down
1 change: 0 additions & 1 deletion api/src/rpc/routes.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ describe("RPC e2e tests", () => {
"name": softwareFormData.softwareName,
"softwareType": softwareFormData.softwareType,
"versionMin": softwareFormData.softwareMinimalVersion ?? undefined,
"testUrls": [],
"workshopUrls": [],
"categories": [],
"isStillInObservation": false,
Expand Down
Loading

0 comments on commit fafa560

Please sign in to comment.