-
Notifications
You must be signed in to change notification settings - Fork 3
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
9 use gitlab git #102
9 use gitlab git #102
Conversation
eb12e5a
to
3965af0
Compare
Instead of 2:45 minutes, the specs take now about 37 seconds.
3965af0
to
64b87bc
Compare
6bd2760
to
4bef0a0
Compare
* Create: http --timeout=3600 -j POST :3000/ada/repo0/ref/master/tree data:='{"attributes": {"content": "aGFuc21laXNlcg==", "encoding": "base64", "commit_message": "do something", "path": "my_test.txt"}}' * Show: http --timeout=3600 -j GET :3000/ada/repo0/ref/master/tree/my_test.txt * Rename without content change: http --timeout=3600 -j PATCH :3000/ada/repo0/ref/master/tree/my_test.txt data:='{"attributes": {"commit_message": "do something", "path": "my_test_renamed.txt"}}' * Rename with content chane: http --timeout=3600 -j PATCH :3000/ada/repo0/ref/master/tree/my_test_renamed.txt data:='{"attributes": {"content": "abc", "encoding": "plain", "commit_message": "do something", "path": "my_test_renamed2.txt"}}' * Delete: http --timeout=3600 -j DELETE :3000/ada/repo0/ref/master/tree/my_test3.txt
…lass table inheritance.
Run all scpes except for the svn-tagged ones with: ``` rspec --tags ~svn ```
4bef0a0
to
6b8587b
Compare
app/models/repository_compound.rb
Outdated
def wrap(repository) | ||
return repository if repository.is_a?(RepositoryCompound) | ||
unless repository.is_a?(Repository) | ||
raise "Object given to ##{__method__} is not a repository" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is untested, which is OK, since it is only triggerd when we mess something up during development. So I would wrap this in nocov
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 3f08fe2
@collection = klass.where(parent_params).all | ||
@collection = klass.where(parent_params) | ||
if @collection.respond_to?(:all) | ||
@collection = @collection.all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dead code for now (and untested), it should be used later. Leaving it untested and without nocov
should be fine, so we don't forget about it.
@repository = Repository.new(*repository_params) | ||
end | ||
|
||
def save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a transaction to not leave dead data in the database if creating a repository in the file system fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 3f08fe2
app/models/repository_compound.rb
Outdated
true | ||
end | ||
|
||
def destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as with save
. rmtree
could fail and leave data in the file system.
app/models/blob.rb
Outdated
@errors.add(:content, 'content must exist') | ||
end | ||
unless content.is_a?(String) | ||
@errors.add(:content, 'content must be a String') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string
it { expect(response).to have_http_status(:ok) } | ||
it { |example| expect([example, response]).to comply_with_api } | ||
|
||
it 'moves the file and ' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and what?
3f08fe2
to
03b7019
Compare
I added a commit to upgrade to the current gitlab_git (v9.0.5). They changed the committing interface. Most of the added code was taken from the previous version of gitlab_git and restructured a little to fit in with the changes. |
56c9e07
to
c63fa48
Compare
This shall fix #9. As a follow-up, I created #85, #96, #97, #98, #99, #100, #101 and #104 for the next steps.
There are already some library methods for these new issues. Most of them only need to be exposed to the Ontohub API.
This pull request depends on ontohub/ontohub-models#67 for the seeds.
Usage
ABCdef123
. Then store it in the shell variableTOKEN
either with base64 encoding