An error occurred fetching the project authors.
- 15 Dec, 2020 1 commit
-
-
Kassio Borges authored
Some Project/Group imports are not importing all the relations due to some *subrelations* (nested relations) being invalid. To avoid that, and fix exceptions like https://gitlab.com/gitlab-org/gitlab/-/issues/285107, every relation created will, from now on, be validated. Though, while working on [enabling](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48179) this validation, some tests failed, exposing that some validations are actually blocking some imports. Validation to check if a _major_ association exists, or follow some kind of requirements, like "DiffNote validating if the MergeRequest is associated", doesn't work in the import process because the relations are created in a _nested_ way. Something like: ``` diff_note = DiffNote.create(diff_note_attributes) mr = MergeRequest.create(mr_attributes, diff_notes: [diff_note]) ``` This commit skip these validations on the importing process, using the `validates :validation, unless: :importing?` pattern. Related to: https://gitlab.com/gitlab-org/gitlab/-/issues/293705
-
- 20 Jul, 2020 1 commit
-
-
Patrick Bajao authored
We also need to display the inapplicable_reason text in another place (`Gitlab::Suggestions::SuggestionSet`). There's no need to return `inapplicable_reason` as symbol for now so it was converted to return text instead.
-
- 03 Jul, 2020 1 commit
-
-
Patrick Bajao authored
In order for frontend to display appropriate messages on why a suggestion can't be applied, it needs to know the reason. A new `inapplicable_reason` property is introduced and included in the API response to achieve that. It is based on the checks to determine whether a suggestion can be applied. The following reasons are: - "You don't have write access to the source branch." - when user has no write access to branch. - "This merge request was merged. To apply this suggestion, edit this file directly." - when MR was merged. - "This merge request is closed. To apply this suggestion, edit this file directly." - when MR is closed. - "Can't apply as the source branch was deleted." - when source branch is deleted. - "Can't apply as this line was changed in a more recent version." - when the line where suggestion is on is outdated. - "Can't apply as these lines were changed in a more recent version." - when lines where suggestion is on are outdated. - "This suggestion already matches its content." - when suggestion has the same content as the line it is on. - "Can't apply this suggestion." - default message when suggestion cannot be applied but doesn't fall into any of criteria above. We won't show this message anywhere right now but it makes sense to return something (e.g. when suggestion is already applied).
-
- 23 Jun, 2020 1 commit
-
-
Arturo Herrero authored
The plan for RSpec 4.0 is to disable monkey patching, reference: https://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode This commit stops using RSpec monkey patching in several specs.
-
- 23 Sep, 2019 1 commit
-
-
Oswaldo Ferreira authored
When expanding diff lines and leaving suggestion comments, eventually, they showed as unnapliable even with no changes in the diff. It happened given the `DiffNote#supports_suggestion?` check was being made at `Suggestion#appliable?` in the discussions iteration. The problem with `DiffNote#supports_suggestion?` as it is that it uses `Position#diff_file`, which has a RequestStore "cache". So for instance, if we have 3 comments in expanded diff lines for the same diff file, just the _first_ expansion would be considered, therefore, just the _first_ suggestion within this set of comments on expanded lines would be appliable. All in all, we're able to simply remove this check from the `appliable?` method given we already check if the note supports suggestions uppon creation (`Suggestions::CreateService`). As an extra outcome, we'll submit less Gitaly requests.
-
- 04 Apr, 2019 1 commit
-
-
Oswaldo Ferreira authored
- added suggestions to mock data - fixed props to be not required
-
- 13 Dec, 2018 2 commits
-
-
Oswaldo Ferreira authored
-
Jacques Erasmus authored
-