chore: remove Elasticsearch integration from the project#719
chore: remove Elasticsearch integration from the project#719
Conversation
Eliminated references to Elasticsearch in the configuration and codebase. This change simplifies the setup and reduces dependencies, focusing on MongoDB as the primary data store.
There was a problem hiding this comment.
Pull request overview
This PR removes Elasticsearch integration from the project by eliminating the mongoosastic package and all associated configuration. The changes simplify the codebase by focusing database operations solely on MongoDB.
- Removed
mongoosasticdependency from multiple package.json files - Deleted Elasticsearch plugin usage and import from the Procedure schema
- Removed Elasticsearch-related environment variables from
.env.example
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
services/cron-jobs/import-named-poll-deputies/package.json |
Removed mongoosastic dependency |
common/bundestagio/package.json |
Removed mongoosastic dependency |
common/bundestagio/src/models/Procedure/schema.ts |
Removed mongoosastic import and plugin usage |
.env.example |
Removed Elasticsearch URL environment variable and updated comment |
pnpm-lock.yaml |
Removed all Elasticsearch-related packages and updated dependency references |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
common/bundestagio/src/models/Procedure/schema.ts:54
- Elasticsearch-specific schema properties (
es_indexed,es_type) are still present in the schema definition but are now unused after removing themongoosasticplugin. These properties should be removed to prevent confusion and maintain code cleanliness. This applies to all fields in the schema that havees_*properties (lines 52-53, 58-59, 64-65, 70-81, 91-93, 100-102, 108-110, 118-119, 126, 133, 141-142).
procedureId: {
type: String,
index: { unique: true },
es_indexed: true,
es_type: 'text',
},
.env.example:1
- Corrected trailing comma in removed line.
AUTH_JWT_SECRET=CHANGE_ME
Eliminated Elasticsearch-specific properties from PartyVotes, ProcessFlow, and Procedure schemas. Removed the mongoosastic type declaration file to clean up the codebase as part of the ongoing refactor.
Docker builds were failing with ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY because pnpm requires the CI environment variable to be set when running in non-interactive environments like Docker builds.
| import { Schema } from 'mongoose'; | ||
|
|
||
| import ProcessDecision, { IProcessDecision } from "./ProcessDecision"; | ||
| import ProcessDecision, { IProcessDecision } from './ProcessDecision'; |
There was a problem hiding this comment.
[nitpick] Inconsistent quote style: This file now uses single quotes ('mongoose'), but other related schema files in the same directory like ProcessDecision.ts, Document.ts, and Plenum.ts use double quotes ("mongoose"). Consider maintaining consistency across all schema files in this directory.
| import { Schema } from 'mongoose'; | ||
|
|
||
| export enum VoteDecision { | ||
| Yes = "YES", | ||
| Abstination = "ABSTINATION", | ||
| No = "NO", | ||
| Notvoted = "NOTVOTED", | ||
| Yes = 'YES', | ||
| Abstination = 'ABSTINATION', | ||
| No = 'NO', | ||
| Notvoted = 'NOTVOTED', |
There was a problem hiding this comment.
[nitpick] Inconsistent quote style: This file now uses single quotes ('mongoose', 'YES', etc.), but other related schema files in the same directory like ProcessDecision.ts, Document.ts, and Plenum.ts use double quotes. Consider maintaining consistency across all schema files in this directory.
This pull request removes Elasticsearch integration from the project, specifically by eliminating the use of the
mongoosasticpackage and related configuration. This simplifies the codebase and dependency management, focusing database operations solely on MongoDB. Several package and lock file updates are also included to clean up dependencies and update some package versions.Removal of Elasticsearch Integration
mongoosasticpackage from dependencies inpackage.json, and deleted all related code fromProcedure/schema.ts, including the plugin usage and import statements. [1] [2] [3].env.example.Dependency and Lock File Cleanup
mongoosastic,@elastic/elasticsearch,elasticsearch, and related agent packages) frompnpm-lock.yamland its snapshots. [1] [2] [3] [4] [5] [6] [7] [8] [9]pnpm-lock.yamlfor consistency and to remove unused transitive dependencies. [1] [2] [3]Miscellaneous Lock File Updates
debug,eslint-import-resolver-typescript, and others, to reflect the cleaned-up dependency tree. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]