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

Automatically en-/dis-able definitions #2161

Merged
merged 10 commits into from
May 18, 2023
Merged

Automatically en-/dis-able definitions #2161

merged 10 commits into from
May 18, 2023

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented May 15, 2023

Resolves #2145

Once deployed, something like the following should be run on the server:

mongosh --quiet CombineDatabase --eval "db.ProjectsCollection.updateMany({}, {\$set: {'definitionsEnabled': false}})" && mongosh --quiet CombineDatabase --eval "db.FrontierCollection.aggregate([{\$unwind:{path:'\$senses'}},{\$unwind:{path:'\$senses.Definitions'}},{\$group:{_id:'\$projectId'}}])" | grep -Eoh '[0-9a-z]{24}' | while read p || [[ -n $p ]]; do mongosh --quiet CombineDatabase --eval "db.ProjectsCollection.updateOne({_id: {\$eq: ObjectId('$p')}}, {\$set: {'definitionsEnabled': true}})"; done

This change is Reviewable

@imnasnainaec imnasnainaec self-assigned this May 15, 2023
@codecov-commenter
Copy link

codecov-commenter commented May 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +22.54 🎉

Comparison is base (42cbb26) 49.50% compared to head (5d3d324) 72.04%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2161       +/-   ##
===========================================
+ Coverage   49.50%   72.04%   +22.54%     
===========================================
  Files         294       43      -251     
  Lines        9494     3957     -5537     
  Branches      694        0      -694     
===========================================
- Hits         4700     2851     -1849     
+ Misses       4239     1106     -3133     
+ Partials      555        0      -555     
Flag Coverage Δ
backend 72.04% <100.00%> (+0.04%) ⬆️
frontend ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Backend/Controllers/LiftController.cs 57.66% <100.00%> (+0.79%) ⬆️
Backend/Services/LiftService.cs 93.85% <100.00%> (+0.03%) ⬆️

... and 250 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@imnasnainaec imnasnainaec enabled auto-merge (squash) May 15, 2023 20:20
@imnasnainaec imnasnainaec marked this pull request as draft May 17, 2023 15:28
auto-merge was automatically disabled May 17, 2023 15:28

Pull request was converted to draft

@imnasnainaec imnasnainaec marked this pull request as ready for review May 17, 2023 17:26
Copy link
Collaborator

@jmgrady jmgrady left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 11 files at r1, 10 of 10 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @imnasnainaec)


Backend.Tests/Controllers/LiftControllerTests.cs line 489 at r2 (raw file):

            Assert.That(proj.DefinitionsEnabled, Is.True);
        }

The only difference that I can see between these two functions is the file to be imported and the expected result. Wouldn't it be easier to maintain if there was a single function to perform this task which receives the filename and expected result as arguments?

@imnasnainaec imnasnainaec enabled auto-merge (squash) May 18, 2023 14:35
Copy link
Collaborator

@jmgrady jmgrady left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @imnasnainaec)

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jmgrady)


Backend.Tests/Controllers/LiftControllerTests.cs line 489 at r2 (raw file):

Previously, jmgrady (Jim Grady) wrote…

The only difference that I can see between these two functions is the file to be imported and the expected result. Wouldn't it be easier to maintain if there was a single function to perform this task which receives the filename and expected result as arguments?

Done.

Copy link
Collaborator

@jmgrady jmgrady left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)

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.

[ProjectSettings] Re-evaluate show-definitions setting
3 participants