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

Fix migrations #1716

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Fix migrations #1716

merged 1 commit into from
Nov 27, 2024

Conversation

ryanmelt
Copy link
Member

No description provided.

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.30%. Comparing base (288b67a) to head (9f975d9).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1716      +/-   ##
==========================================
- Coverage   76.31%   76.30%   -0.02%     
==========================================
  Files         603      603              
  Lines       46101    46101              
  Branches      844      844              
==========================================
- Hits        35184    35176       -8     
- Misses      10821    10828       +7     
- Partials       96       97       +1     
Flag Coverage Δ
frontend 56.18% <ø> (-0.14%) ⬇️
python 83.97% <ø> (ø)
ruby-api 48.70% <ø> (ø)
ruby-backend 82.17% <100.00%> (ø)

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

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

Copy link

sonarcloud bot commented Nov 19, 2024


def self.run
if BASE # Only remove the trigger group microservice if we're not enterprise
MicroserviceModel.get_all_models(scope: 'DEFAULT').each do |microservice_name, microservice_model|
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need to loop through all the scopes like in no_critical_cmd?

Copy link
Member Author

Choose a reason for hiding this comment

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

Base only has DEFAULT scope

@@ -74,13 +74,13 @@ def self.all(scope: nil)
super(PRIMARY_KEY)
end

def self.from_json(json)
def self.from_json(json, scope: nil)
Copy link
Member

Choose a reason for hiding this comment

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

scope is unused ... why is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

It matches the syntax for the base class. Otherwise more of the default methods have to be overriden.

json = JSON.parse(json, :allow_nan => true, :create_additions => true) if String === json
raise "json data is nil" if json.nil?
self.new(**json.transform_keys(&:to_sym))
end

def self.get_model(name:)
def self.get_model(name:, scope: nil)
Copy link
Member

Choose a reason for hiding this comment

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

scope is unused ... why is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

It matches the syntax for the base class. Otherwise more of the default methods have to be overriden.
In particular this broke get_all_models

@ryanmelt ryanmelt merged commit 220bed4 into main Nov 27, 2024
27 checks passed
@ryanmelt ryanmelt deleted the fix_migrations branch November 27, 2024 23:30
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.

2 participants