Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(crowdsource): remove platform from contribution events #1708

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

jo-elimu
Copy link
Member

@jo-elimu jo-elimu commented Jul 11, 2024

ref #1674

Note

Includes DB migration SQL script for altering existing databases in production: 6cd2dfe#diff-ecca7b129fd84cb80790d5006843f71ec549a30959eb2796fd11f91bd7f309b5

@jo-elimu jo-elimu self-assigned this Jul 11, 2024
@jo-elimu jo-elimu linked an issue Jul 11, 2024 that may be closed by this pull request
2 tasks
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.26%. Comparing base (b865b3a) to head (ba7f64d).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1708      +/-   ##
============================================
+ Coverage     15.24%   15.26%   +0.02%     
+ Complexity      451      450       -1     
============================================
  Files           248      248              
  Lines          7623     7592      -31     
  Branches        799      799              
============================================
- Hits           1162     1159       -3     
+ Misses         6411     6383      -28     
  Partials         50       50              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jo-elimu jo-elimu marked this pull request as ready for review July 11, 2024 11:34
@jo-elimu jo-elimu requested a review from a team as a code owner July 11, 2024 11:34
Copy link
Contributor

coderabbitai bot commented Jul 11, 2024

Walkthrough

The changes involve a comprehensive removal of the platform property from the ContributionEvent class and its usage across various parts of the system. This includes eliminating the platform field, as well as its getter and setter methods, from several controllers and database tables. Consequently, all references to the platform property in these files have been deleted, simplifying the event model and its related database schema.

Changes

File/Path Summary
src/main/java/ai/elimu/model/contributor/ContributionEvent.java Removed platform property, getter, and setter methods.
src/main/java/ai/elimu/util/db/DbContentImportHelper.java Removed setting of Platform for various contribution events in performDatabaseContentImport method.
Various LetterCreateController and LetterEditController Removed setting of platform for letterContributionEvent.
Various LetterSoundCreateController and LetterSoundEditController Removed setting of platform for letterSoundContributionEvent.
Various AudioCreateController and AudioEditController Removed setting of platform for audioContributionEvent.
Various ImageCreateController and ImageEditController Removed setting of platform for imageContributionEvent.
Various NumberCreateController and NumberEditController Removed setting of platform for numberContributionEvent.
Various SoundCreateController and SoundEditController Removed setting of platform for soundContributionEvent.
Various StoryBookCreateController, StoryBookEditController, StoryBookCreateFromEPubController, and others Removed setting of platform for storyBookContributionEvent and imageContributionEvent.
Various StoryBookChapterCreateController, StoryBookChapterDeleteController, StoryBookParagraphCreateController, StoryBookParagraphDeleteController, and StoryBookParagraphEditController Removed setting of platform for storyBookContributionEvent.
Various WordCreateController and WordEditController Removed setting of platform for wordContributionEvent and removed related audio dependencies.
src/main/resources/META-INF/jpa-schema-export.sql Removed platform field from multiple tables in the database schema.
src/main/resources/db/migration/2004004.sql Dropped platform column from various contribution event tables.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6cd2dfe and ba7f64d.

Files selected for processing (1)
  • src/main/java/ai/elimu/model/contributor/ContributionEvent.java (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/ai/elimu/model/contributor/ContributionEvent.java

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jo-elimu jo-elimu changed the title refactor(crowdsource): remove platform refactor(crowdsource): remove platform from contributions events Jul 11, 2024
@jo-elimu jo-elimu mentioned this pull request Jul 11, 2024
2 tasks
@jo-elimu jo-elimu changed the title refactor(crowdsource): remove platform from contributions events refactor(crowdsource): remove platform from contribution events Jul 11, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (9)
src/main/java/ai/elimu/web/content/storybook/paragraph/StoryBookParagraphEditController.java (1)

1-1: References to AudioDao still exist in related files.

The references to AudioDao have not been completely removed from the codebase. They are still present in the following files:

  • src/main/java/ai/elimu/web/content/storybook/paragraph/StoryBookParagraphDeleteController.java
  • src/main/java/ai/elimu/web/content/storybook/paragraph/StoryBookParagraphCreateController.java

Please ensure that all references to AudioDao are removed as part of the clean-up process.

Analysis chain

Confirm removal of references to AudioContributionEventDao and AudioDao.

Ensure that all references to AudioContributionEventDao and AudioDao are removed from the file, as their imports have been deleted.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of references to `AudioContributionEventDao` and `AudioDao` in `StoryBookParagraphEditController`.

# Test: Search for references to `AudioContributionEventDao` and `AudioDao`. Expect: No results.
rg --type java 'AudioContributionEventDao|AudioDao' src/main/java/ai/elimu/web/content/storybook/paragraph/StoryBookParagraphEditController.java

Length of output: 146


Script:

#!/bin/bash
# Description: Verify the removal of references to `AudioContributionEventDao` and `AudioDao` in the entire `storybook/paragraph` directory.

# Test: Search for references to `AudioContributionEventDao` and `AudioDao` in all files under `storybook/paragraph`. Expect: No results.
rg --type java 'AudioContributionEventDao|AudioDao' src/main/java/ai/elimu/web/content/storybook/paragraph

Length of output: 610

src/main/java/ai/elimu/web/content/storybook/paragraph/StoryBookParagraphDeleteController.java (1)

References to AudioDao are still present.

The AudioDao import and its usage within the StoryBookParagraphDeleteController file have not been removed, which contradicts the PR objective of removing related dependencies.

  • import ai.elimu.dao.AudioDao;
  • private AudioDao audioDao;

Please ensure all references to AudioDao are removed from the file.

Analysis chain

Line range hint 1-1:
Confirm removal of references to AudioDao.

Ensure that all references to AudioDao are removed from the file, as its import has been deleted.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of references to `AudioDao` in `StoryBookParagraphDeleteController`.

# Test: Search for references to `AudioDao`. Expect: No results.
rg --type java 'AudioDao' src/main/java/ai/elimu/web/content/storybook/paragraph/StoryBookParagraphDeleteController.java

Length of output: 181

src/main/java/ai/elimu/util/db/DbContentImportHelper.java (7)

Line range hint 82-82:
Remove unused import.

The import statement for Platform is no longer needed and should be removed to clean up the code.

- import ai.elimu.model.enums.Platform;

Line range hint 98-98:
Remove unused import.

The import statement for Platform is no longer needed and should be removed to clean up the code.

- import ai.elimu.model.enums.Platform;

Line range hint 188-188:
Remove unused import.

The import statement for Platform is no longer needed and should be removed to clean up the code.

- import ai.elimu.model.enums.Platform;

Line range hint 207-207:
Remove unused import.

The import statement for Platform is no longer needed and should be removed to clean up the code.

- import ai.elimu.model.enums.Platform;

Line range hint 225-225:
Remove unused import.

The import statement for Platform is no longer needed and should be removed to clean up the code.

- import ai.elimu.model.enums.Platform;

Line range hint 258-258:
Remove unused import.

The import statement for Platform is no longer needed and should be removed to clean up the code.

- import ai.elimu.model.enums.Platform;

Line range hint 280-280:
Remove unused import.

The import statement for Platform is no longer needed and should be removed to clean up the code.

- import ai.elimu.model.enums.Platform;

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 11, 2024
@nya-elimu nya-elimu merged commit 0b66ac2 into main Jul 11, 2024
10 checks passed
@nya-elimu nya-elimu deleted the 1674-delete-platform-enum branch July 11, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete Platform enum
2 participants