Skip to content

Update Api.getRawFile to make ref param optional[RUN-AS-IF-FOSS]

Jiaan Louw requested to merge 327200-update-getrawfile-params into master

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

Availability and Testing

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

Merge request reports

Loading