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

Development Environment Docs & Improvements #1358

Merged

Conversation

sneakers-the-rat
Copy link
Contributor

Redo: #1356 without model annotations

This PR:

  • Add more docs on setting up development environment
  • Don't validate review repository URLs on creating Paper objects if in the development environment so that it's possible to create fake papers/reviews for testing
  • Add a "paper" type to dev environment config
  • Create some basic seed data for dev environment.

Questions:

  • is the readme the right place? i also notice https://github.com/openjournals/joss/blob/main/docs/installing.md which seems more like if you were to want to do a secondary deployment for a different journal, but just checking
  • I only added enough seed data to be able to test fix authors with periods in names #1357 , so eg. I didn't put a full paper body in there. is there some way to use the factory classes in the spec directory like https://github.com/openjournals/joss/blob/main/spec/factories/papers_factory.rb in db/seeds.rb? I don't know enough about ruby environments, wasn't sure how to call that, but that would probably be preferable to use those, so then we could create a full seed dataset with all the types of models from the same sources that the tests use. If that is possible/desirable, i can follow on with another PR for that, seems like it would be a nice thing to do both for people checking this out if they wanted to do a secondary deployment and also for quick debugging purposes.

@@ -146,7 +146,7 @@ class Paper < ApplicationRecord
validates :kind, inclusion: { in: Rails.application.settings["paper_types"] }, allow_nil: true
validates :submission_kind, inclusion: { in: SUBMISSION_KINDS, message: "You must select a submission type" }, allow_nil: false
validates_format_of :repository_url, with: /\Ahttps?:\/\//i, on: :create, message: "Repository URL is missing the protocol segment (http/https)"
validate :check_repository_address, on: :create, unless: Proc.new {|paper| paper.is_a_retraction_notice?}
validate :check_repository_address, on: :create, unless: Proc.new {|paper| Rails.env.development? || paper.is_a_retraction_notice?}
Copy link
Member

Choose a reason for hiding this comment

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

😍

@arfon arfon merged commit 902b428 into openjournals:main Oct 6, 2024
1 check passed
@arfon
Copy link
Member

arfon commented Oct 6, 2024

Thanks @sneakers-the-rat !

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