Skip to content

Failure in api/1_manage/project_access_token_spec.rb | Manage Project access token for the same project can be used to create a file via the project API

Full description

Manage Project access token for the same project can be used to create a file via the project API

File path

./qa/specs/features/api/1_manage/project_access_token_spec.rb

Stack trace

Failure/Error:
  expect do
    Resource::File.fabricate_via_api! do |file|
      file.api_client = @user_api_client
      file.project = @project_access_token.project
      file.branch = "new_branch_#{SecureRandom.hex(8)}"
      file.commit_message = 'Add new file'
      file.name = "text-#{SecureRandom.hex(8)}.txt"
      file.content = 'New file'
    end
  end.not_to raise_error

  expected no Exception, got #<QA::Resource::Errors::ResourceFabricationFailedError: Fabrication of QA::Resource::File using the API failed (403) with `{"message":"403 Forbidden"}`.
  Correlation Id: 01GA809HH5QCZTED0NK0F1BNMZ> with backtrace:
    # ./qa/resource/api_fabricator.rb:145:in `api_post_to'
    # ./qa/resource/api_fabricator.rb:122:in `api_post'
    # ./qa/resource/api_fabricator.rb:27:in `fabricate_via_api!'
    # ./qa/resource/base.rb:51:in `block (2 levels) in fabricate_via_api!'
    # ./qa/resource/base.rb:82:in `log_and_record_fabrication'
    # ./qa/resource/base.rb:51:in `block in fabricate_via_api!'
    # ./qa/resource/base.rb:72:in `do_fabricate!'
    # ./qa/resource/base.rb:50:in `fabricate_via_api!'
    # ./qa/specs/features/api/1_manage/project_access_token_spec.rb:17:in `block (5 levels) in <module:QA>'
    # ./qa/specs/features/api/1_manage/project_access_token_spec.rb:16:in `block (4 levels) in <module:QA>'
    # ./qa/specs/spec_helper.rb:147:in `block (2 levels) in <top (required)>'
    # ./qa/specs/knapsack_runner.rb:15:in `run'
    # ./qa/specs/runner.rb:55:in `perform'
    # ./qa/scenario/template.rb:10:in `block in perform'
    # ./qa/scenario/template.rb:8:in `tap'
    # ./qa/scenario/template.rb:8:in `perform'
    # ./qa/scenario/template.rb:50:in `perform'
    # ./qa/scenario/template.rb:10:in `block in perform'
    # ./qa/scenario/template.rb:8:in `tap'
    # ./qa/scenario/template.rb:8:in `perform'
    # ./qa/scenario/bootable.rb:51:in `launch!'

First happened in https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/2847601072.

Related test case: https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347858.