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

fixup(dev): device seed #1945

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

PiTrem
Copy link
Member

@PiTrem PiTrem commented May 24, 2024

  • refactor device seed to the new Device model
  • use example config file as a temporary application datacollectors config
  • device creation idempotent but ⚠️ device not updated if already there

NB: when updating the devices, validation might fail if the application datacollectors local path config
does not fit the one set for the device

@PiTrem PiTrem linked an issue May 24, 2024 that may be closed by this pull request
@PiTrem PiTrem marked this pull request as draft May 24, 2024 15:17
@PiTrem PiTrem force-pushed the 1941-bundle-exec-rails-dbsetup-fails-in-development branch 2 times, most recently from 076c837 to e01bbe2 Compare May 26, 2024 18:47
Copy link

LCOV of commit e01bbe2 during Continuous Integration #2878

Summary coverage rate:
  lines......: 64.1% (13675 of 21337 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@PiTrem PiTrem marked this pull request as ready for review May 27, 2024 07:06
Copy link
Collaborator

Choose a reason for hiding this comment

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

bundle exec rails db:setup fails with

*** Loading development seed data from /home/chemotion-dev/app/db/seeds/development/devices.seed.rb
Creating device D1...
rails aborted!
ActiveRecord::RecordInvalid: Validation failed: Datacollector dir Watch directory is not a valid directory
/home/chemotion-dev/app/db/seeds/development/devices.seed.rb:38:in `block in <main>'
/home/chemotion-dev/app/db/seeds/development/devices.seed.rb:36:in `each'
/home/chemotion-dev/app/db/seeds/development/devices.seed.rb:36:in `<main>'
/home/chemotion-dev/app/db/seeds.rb:15:in `block (2 levels) in <main>'
/home/chemotion-dev/app/db/seeds.rb:13:in `each'
/home/chemotion-dev/app/db/seeds.rb:13:in `block in <main>'
/home/chemotion-dev/app/db/seeds.rb:4:in `each'
/home/chemotion-dev/app/db/seeds.rb:4:in `<main>'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)

Copy link
Member Author

Choose a reason for hiding this comment

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

2 options

  • skip or trick the validation (update_columns or temporary set a datacollector config)
  • have a compliant datacollector config

Went for the 2nd (although if a datacollector.yml is already there it should be checked)

Copy link

LCOV of commit 59688f9 during Continuous Integration #2892

Summary coverage rate:
  lines......: 64.1% (13675 of 21337 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@PiTrem PiTrem force-pushed the 1941-bundle-exec-rails-dbsetup-fails-in-development branch 3 times, most recently from 8e54a1f to 43ff71d Compare June 4, 2024 14:09
@PiTrem PiTrem force-pushed the 1941-bundle-exec-rails-dbsetup-fails-in-development branch from 43ff71d to 03ce132 Compare June 4, 2024 17:52
Copy link

github-actions bot commented Jun 4, 2024

LCOV of commit 03ce132 during Continuous Integration #2927

Summary coverage rate:
  lines......: 64.1% (13672 of 21316 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@PiTrem PiTrem merged commit 9f850a3 into main Jun 4, 2024
3 checks passed
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.

bundle exec rails db:setup fails in development
2 participants