-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5118 from dodona-edu/fix/unique_clone_url
Add uniqueness validation to repository remote url
- Loading branch information
Showing
5 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddUniqueToRepositoryRemote < ActiveRecord::Migration[7.1] | ||
def change | ||
add_index :repositories, :remote, unique: true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -276,6 +276,9 @@ def fill_series_with_realistic_submissions(s) | |
puts activity_repo.errors.full_messages unless activity_repo.valid? | ||
activity_repo.process_activities | ||
|
||
# remote must be unique for the repository, and we want to clone it again | ||
activity_repo.update!(remote: '-') | ||
|
||
big_activity_repo = Repository.create name: 'A lot of python activities', remote: '[email protected]:dodona-edu/example-exercises.git', judge: python_judge, allowed_courses: courses | ||
Delayed::Worker.delay_jobs = true | ||
Dir.glob("#{big_activity_repo.full_path}/*") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters