Skip to content

Commit

Permalink
Merge branch 'master' into yui-switch-to-jre
Browse files Browse the repository at this point in the history
Fix trivial conflicts in script/install.bash
  • Loading branch information
tom93 committed May 15, 2024
2 parents 2be75ea + 095d12c commit 1f72b98
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 86 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
Expand All @@ -46,7 +46,10 @@ jobs:
SCHEDULE_BACKUPS: 0
ISOLATE_ROOT: /
ISOLATE_CGROUPS: false
ISOLATE_BRANCH: master
ISOLATE_BRANCH: v1.10.1

- name: Back up db/schema.rb # it will be overwritten when install.bash runs migrate.bash; back up the original so we can check if it's up to date
run: cp db/schema.rb db/schema.rb.git

- run: AUTOCONFIRM=true script/install.bash
env:
Expand All @@ -57,12 +60,17 @@ jobs:
#- run: bundle exec rake db:test:load # not required because script/install.bash runs db:migrate
- run: bundle exec rspec

- name: Check that db/schema.rb is up to date
run: |
diff -u db/schema.rb.git db/schema.rb >&2 ||
{ echo "Error: db/schema.rb is out of date" >&2; exit 1; }
- uses: coverallsapp/github-action@v2

lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/filelinks/roots_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ def create
self.model = load_model
authorize model, :update?
authorize FileAttachment.find(filelink_params[:file_attachment_id]), :use?
@new_file = model.filelinks.build(filelink_params)
if @new_file.save
@new_filelink = model.filelinks.build(filelink_params)
if @new_filelink.save
redirect_to(index_path, :notice => "File attachment added")
else
@files = model.filelinks.order(:filepath)
@filelinks = model.filelinks.order(:filepath)
render :action => :index
end
end
Expand Down
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = true # true so Webrick testing of production mode works
config.serve_static_files = true # true so Webrick testing of production mode works

# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
Expand All @@ -49,7 +49,7 @@
config.i18n.fallbacks = true

# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
config.active_support.deprecation = :log

# Compress JavaScript and CSS
config.assets.compress = true
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
config.active_support.deprecation = :stderr

# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"

# Raise exception on mass assignment protection for Active Record models
Expand Down
82 changes: 41 additions & 41 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "contest_relations", force: true do |t|
create_table "contest_relations", force: :cascade do |t|
t.integer "user_id"
t.integer "contest_id"
t.datetime "started_at"
Expand All @@ -40,7 +40,7 @@
add_index "contest_relations", ["contest_id", "user_id"], name: "index_contest_relations_on_contest_id_and_user_id", unique: true, using: :btree
add_index "contest_relations", ["user_id", "started_at"], name: "index_contest_relations_on_user_id_and_started_at", using: :btree

create_table "contest_scores", force: true do |t|
create_table "contest_scores", force: :cascade do |t|
t.integer "contest_relation_id", null: false
t.integer "problem_id", null: false
t.integer "score"
Expand All @@ -52,7 +52,7 @@

add_index "contest_scores", ["contest_relation_id", "problem_id"], name: "index_contest_scores_on_contest_relation_id_and_problem_id", using: :btree

create_table "contest_supervisors", force: true do |t|
create_table "contest_supervisors", force: :cascade do |t|
t.integer "contest_id"
t.integer "user_id"
t.string "site_type"
Expand All @@ -62,7 +62,7 @@
t.datetime "scheduled_start_time"
end

create_table "contests", force: true do |t|
create_table "contests", force: :cascade do |t|
t.string "name"
t.datetime "start_time"
t.datetime "end_time"
Expand All @@ -80,13 +80,13 @@
t.boolean "only_rank_official_contestants", default: false
end

create_table "entities", force: true do |t|
create_table "entities", force: :cascade do |t|
t.string "name"
t.integer "entity_id"
t.string "entity_type"
end

create_table "evaluators", force: true do |t|
create_table "evaluators", force: :cascade do |t|
t.string "name", null: false
t.text "description", default: "", null: false
t.text "source", default: "", null: false
Expand All @@ -95,15 +95,15 @@
t.datetime "updated_at"
end

create_table "file_attachments", force: true do |t|
create_table "file_attachments", force: :cascade do |t|
t.string "name"
t.string "file_attachment"
t.integer "owner_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "filelinks", force: true do |t|
create_table "filelinks", force: :cascade do |t|
t.integer "root_id"
t.integer "file_attachment_id"
t.datetime "created_at"
Expand All @@ -115,21 +115,21 @@
add_index "filelinks", ["file_attachment_id"], name: "index_filelinks_on_file_attachment_id", using: :btree
add_index "filelinks", ["root_id", "filepath"], name: "index_filelinks_on_root_id_and_filepath", using: :btree

create_table "group_contests", force: true do |t|
create_table "group_contests", force: :cascade do |t|
t.integer "group_id"
t.integer "contest_id"
end

add_index "group_contests", ["contest_id", "group_id"], name: "index_group_contests_on_contest_id_and_group_id", using: :btree
add_index "group_contests", ["group_id", "contest_id"], name: "index_group_contests_on_group_id_and_contest_id", using: :btree

create_table "group_memberships", force: true do |t|
create_table "group_memberships", force: :cascade do |t|
t.integer "group_id"
t.integer "member_id"
t.datetime "created_at"
end

create_table "group_problem_sets", force: true do |t|
create_table "group_problem_sets", force: :cascade do |t|
t.integer "group_id"
t.integer "problem_set_id"
t.string "name"
Expand All @@ -138,7 +138,7 @@
add_index "group_problem_sets", ["group_id", "problem_set_id"], name: "index_group_problem_sets_on_group_id_and_problem_set_id", using: :btree
add_index "group_problem_sets", ["problem_set_id", "group_id"], name: "index_group_problem_sets_on_problem_set_id_and_group_id", using: :btree

create_table "groups", force: true do |t|
create_table "groups", force: :cascade do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
Expand All @@ -147,7 +147,7 @@
t.integer "membership", default: 0, null: false
end

create_table "item_histories", force: true do |t|
create_table "item_histories", force: :cascade do |t|
t.integer "item_id"
t.boolean "active"
t.integer "action"
Expand All @@ -158,7 +158,7 @@
t.datetime "updated_at"
end

create_table "items", force: true do |t|
create_table "items", force: :cascade do |t|
t.integer "product_id"
t.integer "owner_id"
t.integer "organisation_id"
Expand All @@ -170,7 +170,7 @@
t.integer "scan_token"
end

create_table "language_groups", force: true do |t|
create_table "language_groups", force: :cascade do |t|
t.string "identifier"
t.string "name"
t.integer "current_language_id"
Expand All @@ -180,7 +180,7 @@

add_index "language_groups", ["identifier"], name: "index_language_groups_on_identifier", unique: true, using: :btree

create_table "languages", force: true do |t|
create_table "languages", force: :cascade do |t|
t.string "identifier"
t.string "compiler"
t.boolean "interpreted"
Expand All @@ -201,17 +201,17 @@

add_index "languages", ["identifier"], name: "index_languages_on_identifier", unique: true, using: :btree

create_table "organisations", force: true do |t|
create_table "organisations", force: :cascade do |t|
end

create_table "problem_series", force: true do |t|
create_table "problem_series", force: :cascade do |t|
t.string "name"
t.string "identifier"
t.string "importer_type"
t.text "index_yaml"
end

create_table "problem_set_problems", force: true do |t|
create_table "problem_set_problems", force: :cascade do |t|
t.integer "problem_set_id"
t.integer "problem_id"
t.integer "problem_set_order"
Expand All @@ -221,15 +221,15 @@
add_index "problem_set_problems", ["problem_id", "problem_set_id"], name: "index_problem_set_problems_on_problem_id_and_problem_set_id", using: :btree
add_index "problem_set_problems", ["problem_set_id", "problem_id"], name: "index_problem_set_problems_on_problem_set_id_and_problem_id", using: :btree

create_table "problem_sets", force: true do |t|
create_table "problem_sets", force: :cascade do |t|
t.string "name"
t.integer "owner_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "finalized_contests_count", default: 0
end

create_table "problems", force: true do |t|
create_table "problems", force: :cascade do |t|
t.string "name"
t.text "statement"
t.string "input"
Expand All @@ -246,44 +246,44 @@
t.integer "test_status", default: 0
end

create_table "products", force: true do |t|
create_table "products", force: :cascade do |t|
t.string "name"
t.integer "gtin", limit: 8
t.text "description"
t.string "image"
end

create_table "requests", force: true do |t|
create_table "requests", force: :cascade do |t|
t.integer "requester_id"
t.integer "subject_id"
t.string "subject_type"
t.string "verb", null: false
t.integer "target_id", null: false
t.string "target_type", null: false
t.integer "status", default: 0, null: false
t.string "verb", null: false
t.integer "target_id", null: false
t.string "target_type", null: false
t.integer "status", default: 0, null: false
t.integer "requestee_id"
t.datetime "expired_at", default: Infinity, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "expired_at", default: 'Infinity', null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "roles", force: true do |t|
create_table "roles", force: :cascade do |t|
t.string "name"
end

create_table "roles_users", id: false, force: true do |t|
create_table "roles_users", id: false, force: :cascade do |t|
t.integer "role_id"
t.integer "user_id"
end

create_table "schools", force: true do |t|
create_table "schools", force: :cascade do |t|
t.string "name"
t.string "country_code", limit: 2
t.integer "users_count"
t.integer "synonym_id"
end

create_table "sessions", force: true do |t|
create_table "sessions", force: :cascade do |t|
t.string "session_id", null: false
t.text "data"
t.datetime "created_at"
Expand All @@ -294,14 +294,14 @@
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree

create_table "settings", force: true do |t|
create_table "settings", force: :cascade do |t|
t.string "key"
t.string "value"
end

add_index "settings", ["key"], name: "index_settings_on_key", unique: true, using: :btree

create_table "submissions", force: true do |t|
create_table "submissions", force: :cascade do |t|
t.text "source"
t.integer "score"
t.integer "user_id"
Expand All @@ -325,7 +325,7 @@
add_index "submissions", ["problem_id", "created_at"], name: "index_submissions_on_problem_id_and_created_at", using: :btree
add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree

create_table "test_case_relations", force: true do |t|
create_table "test_case_relations", force: :cascade do |t|
t.integer "test_case_id"
t.integer "test_set_id"
t.datetime "created_at", null: false
Expand All @@ -335,7 +335,7 @@
add_index "test_case_relations", ["test_case_id"], name: "index_test_case_relations_on_test_case_id", using: :btree
add_index "test_case_relations", ["test_set_id"], name: "index_test_case_relations_on_test_set_id", using: :btree

create_table "test_cases", force: true do |t|
create_table "test_cases", force: :cascade do |t|
t.text "input"
t.text "output"
t.string "name"
Expand All @@ -348,7 +348,7 @@

add_index "test_cases", ["problem_id", "name"], name: "index_test_cases_on_problem_id_and_name", unique: true, using: :btree

create_table "test_sets", force: true do |t|
create_table "test_sets", force: :cascade do |t|
t.integer "problem_id"
t.integer "points"
t.string "name"
Expand All @@ -360,7 +360,7 @@

add_index "test_sets", ["problem_id", "name"], name: "index_test_sets_on_problem_id_and_name", unique: true, using: :btree

create_table "user_problem_relations", force: true do |t|
create_table "user_problem_relations", force: :cascade do |t|
t.integer "problem_id"
t.integer "user_id"
t.integer "submissions_count"
Expand All @@ -376,7 +376,7 @@
add_index "user_problem_relations", ["problem_id", "ranked_score"], name: "index_user_problem_relations_on_problem_id_and_ranked_score", using: :btree
add_index "user_problem_relations", ["user_id", "problem_id"], name: "index_user_problem_relations_on_user_id_and_problem_id", unique: true, using: :btree

create_table "users", force: true do |t|
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
Expand Down
2 changes: 0 additions & 2 deletions script/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ bash script/install/nztrain.bash || exit 1 # fix files & directory structure

bash script/install/bundler.bash || exit 1

bash script/install/nokogiri.bash || exit 1 # nokogiri dependencies

bash script/install/jre.bash || exit 1 # required by yui-compressor

sudo bash script/install/isolate.bash || exit 1 # install isolate
Expand Down
2 changes: 1 addition & 1 deletion script/install/config.bash
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ declare -p ISOLATE_CGROUPS &> /dev/null || while [ -z "$ISOLATE_CGROUPS" ] ; do
else ISOLATE_CGROUPS=false; fi
done

declare -p ISOLATE_BRANCH &> /dev/null || ISOLATE_BRANCH=master # no prompt
declare -p ISOLATE_BRANCH &> /dev/null || ISOLATE_BRANCH=v1.10.1 # no prompt


shopt -u nocasematch;
Expand Down
Loading

0 comments on commit 1f72b98

Please sign in to comment.