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

Add new consistency check at boot time: Userfile and CbrainTask classes verification #969

Open
prioux opened this issue Jul 23, 2020 · 4 comments · May be fixed by #1369
Open

Add new consistency check at boot time: Userfile and CbrainTask classes verification #969

prioux opened this issue Jul 23, 2020 · 4 comments · May be fixed by #1369
Assignees
Labels
Admin Features or bugs related to administrative features Enhancement Installation Priority: High

Comments

@prioux
Copy link
Member

prioux commented Jul 23, 2020

Add a new boot-time validation method to check that all the 'type' columns of our single table inheritance models represent ruby classes that are properly loaded.

For tasks, that would be:

not_loaded = CbrainTask.group(:type).pluck(:type).select do |name|
    (name.constantize rescue nil) ? nil : name
end
@prioux prioux added the Admin Features or bugs related to administrative features label Jun 3, 2021
@MontrealSergiy
Copy link
Contributor

MontrealSergiy commented Jan 29, 2024

Data-providers should be included too?

@prioux Actually there is a benefit in not having that feature. When one works on several features/PR in the same time, and some of them involve new tasks or userfiles, it is not necessary to wipe up to database after branch switch. Maybe not the case with you, but Natacha, most likely, integrates or tests few new tools in the same time.

Well, if still needed, please confirm

@prioux
Copy link
Member Author

prioux commented Jan 29, 2024

I want that check at boot time, it is an important piece of information. In developement, maybe print a warning about the classes; in production, stop the boot process entirely.

Since not all CbrainTask classes are deplpyed on the Bourreaux, the check for the types for the cbrain_tasks table should be restricted to those rows which have an ID matching the current app.

For userfiles and data providers, it must be a fatal error always.

@MontrealSergiy MontrealSergiy self-assigned this Jan 29, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Jan 31, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 1, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 1, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 1, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 1, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 1, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 1, 2024
MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 2, 2024
@MontrealSergiy
Copy link
Contributor

@prioux can you clarify

"ID matching the current app
rows which have an ID matching the current app"

Do you suggest restrict by bourreau_id == current_bourreau.id ?

Since not all CbrainTask classes are deplpyed on the Bourreaux, the check for the types for the cbrain_tasks table should be restricted to those rows which have an ID matching the current app.

@prioux
Copy link
Member Author

prioux commented Feb 2, 2024

Yes exactly.

MontrealSergiy added a commit to MontrealSergiy/cbrain that referenced this issue Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Features or bugs related to administrative features Enhancement Installation Priority: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants