Update Api.getRawFile to make ref param optional[RUN-AS-IF-FOSS]
What does this MR do?
Following the api update #323450 (closed) the ref
param is now optional and default to HEAD
or default branch. Thus we can update the getRawFile
method to match as described in #327200 (closed). This is also part of the effort to update the initial branch name in our frontend code https://gitlab.com/gitlab-org/gitlab/-/issues/324100.
Scans
grep -v -r --include=\*.js --include=\*.vue '^\s*\/\/\|^\s*\*' ./app | grep 'getRawFile\W'
./app/assets/javascripts/static_site_editor/services/load_source_content.js: Api.getRawFile(projectId, sourcePath).then(({ data }) => ({
./app/assets/javascripts/pipeline_editor/graphql/resolvers.js: rawData: Api.getRawFile(projectPath, path, { ref }).then(({ data }) => {
./app/assets/javascripts/api.js: getRawFile(id, path, params) {
grep -v -r --include=\*.js --include=\*.vue '^\s*\/\/\|^\s*\*' ./ee/app | grep 'getRawFile\W'
./ee/app/assets/javascripts/groups/settings/compliance_frameworks/utils.js: const { status } = await Api.getRawFile(`${group}/${project}`, file);
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because no visual change
.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #327200 (closed)
Edited by Jose Ivan Vargas