diff --git a/app/controllers/concerns/boards_actions.rb b/app/controllers/concerns/boards_actions.rb index 7bffe1e1141..8c2b0300589 100644 --- a/app/controllers/concerns/boards_actions.rb +++ b/app/controllers/concerns/boards_actions.rb @@ -7,6 +7,7 @@ module BoardsActions included do include BoardsResponses + before_action :authorize_read_board!, only: [:index, :show] before_action :boards, only: :index before_action :board, only: :show before_action :push_licensed_features, only: [:index, :show] diff --git a/app/controllers/groups/boards_controller.rb b/app/controllers/groups/boards_controller.rb index be38fe25842..e1f09d73739 100644 --- a/app/controllers/groups/boards_controller.rb +++ b/app/controllers/groups/boards_controller.rb @@ -5,7 +5,6 @@ class Groups::BoardsController < Groups::ApplicationController include RecordUserLastActivity include Gitlab::Utils::StrongMemoize - before_action :authorize_read_board!, only: [:index, :show] before_action :assign_endpoint_vars before_action do push_frontend_feature_flag(:graphql_board_lists, group, default_enabled: false) diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb index 349649c7b35..9a3e9437426 100644 --- a/app/controllers/projects/boards_controller.rb +++ b/app/controllers/projects/boards_controller.rb @@ -5,7 +5,6 @@ class Projects::BoardsController < Projects::ApplicationController include IssuableCollections before_action :check_issues_available! - before_action :authorize_read_board!, only: [:index, :show] before_action :assign_endpoint_vars before_action do push_frontend_feature_flag(:swimlanes_buffered_rendering, project, default_enabled: :yaml) diff --git a/app/models/concerns/prometheus_adapter.rb b/app/models/concerns/prometheus_adapter.rb index b26d376bb9b..afebc426762 100644 --- a/app/models/concerns/prometheus_adapter.rb +++ b/app/models/concerns/prometheus_adapter.rb @@ -33,7 +33,7 @@ module PrometheusAdapter # This is a light-weight check if a prometheus client is properly configured. def configured? - raise NotImplemented + raise NotImplementedError end # This is a heavy-weight check if a prometheus is properly configured and accessible from GitLab. diff --git a/app/models/user.rb b/app/models/user.rb index 92cbf863d63..581a1bd893b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -205,6 +205,7 @@ class User < ApplicationRecord has_one :user_detail has_one :user_highest_role has_one :user_canonical_email + has_one :credit_card_validation, class_name: '::Users::CreditCardValidation' has_one :atlassian_identity, class_name: 'Atlassian::Identity' has_many :reviews, foreign_key: :author_id, inverse_of: :author @@ -317,6 +318,7 @@ class User < ApplicationRecord accepts_nested_attributes_for :user_preference, update_only: true accepts_nested_attributes_for :user_detail, update_only: true + accepts_nested_attributes_for :credit_card_validation, update_only: true state_machine :state, initial: :active do event :block do @@ -1223,6 +1225,10 @@ class User < ApplicationRecord user_highest_role&.highest_access_level || Gitlab::Access::NO_ACCESS end + def credit_card_validated_at + credit_card_validation&.credit_card_validated_at + end + def accessible_deploy_keys DeployKey.from_union([ DeployKey.where(id: project_deploy_keys.select(:deploy_key_id)), diff --git a/app/models/users/credit_card_validation.rb b/app/models/users/credit_card_validation.rb new file mode 100644 index 00000000000..2ccebc65552 --- /dev/null +++ b/app/models/users/credit_card_validation.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Users + class CreditCardValidation < ApplicationRecord + self.table_name = 'user_credit_card_validations' + + belongs_to :user + end +end diff --git a/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json b/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json index dc4880946b2..7c3720dd2e6 100644 --- a/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json +++ b/app/validators/json_schemas/security_ci_configuration_schemas/sast_ui_schema.json @@ -160,6 +160,13 @@ "description": ".NET Core, .NET Framework", "variables": [] }, + { + "name": "semgrep", + "label": "Semgrep", + "enabled": true, + "description": "Multi-language scanning", + "variables": [] + }, { "name": "sobelow", "label": "Sobelow", diff --git a/changelogs/unreleased/202423-validate-foreign-key-on-group-hooks.yml b/changelogs/unreleased/202423-validate-foreign-key-on-group-hooks.yml new file mode 100644 index 00000000000..bf39cf13dd4 --- /dev/null +++ b/changelogs/unreleased/202423-validate-foreign-key-on-group-hooks.yml @@ -0,0 +1,5 @@ +--- +title: Validate foreign key on GroupHooks +merge_request: 60527 +author: +type: other diff --git a/changelogs/unreleased/328066-semgrep-config-ui.yml b/changelogs/unreleased/328066-semgrep-config-ui.yml new file mode 100644 index 00000000000..e1a592c9d0c --- /dev/null +++ b/changelogs/unreleased/328066-semgrep-config-ui.yml @@ -0,0 +1,5 @@ +--- +title: Add semgrep to SAST config UI +merge_request: 60460 +author: +type: added diff --git a/changelogs/unreleased/migrate-create-table-user-credit-card-validations.yml b/changelogs/unreleased/migrate-create-table-user-credit-card-validations.yml new file mode 100644 index 00000000000..cabaea5159c --- /dev/null +++ b/changelogs/unreleased/migrate-create-table-user-credit-card-validations.yml @@ -0,0 +1,5 @@ +--- +title: Create table user_credit_card_validations +merge_request: 60626 +author: +type: changed diff --git a/changelogs/unreleased/populate-timelogs-project_id.yml b/changelogs/unreleased/populate-timelogs-project_id.yml new file mode 100644 index 00000000000..db133120b64 --- /dev/null +++ b/changelogs/unreleased/populate-timelogs-project_id.yml @@ -0,0 +1,5 @@ +--- +title: Populate timelogs.project_id +merge_request: 60439 +author: Lee Tickett @leetickett +type: added diff --git a/db/migrate/20210428151144_update_invalid_web_hooks.rb b/db/migrate/20210428151144_update_invalid_web_hooks.rb new file mode 100644 index 00000000000..4f45e7aaa9b --- /dev/null +++ b/db/migrate/20210428151144_update_invalid_web_hooks.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class UpdateInvalidWebHooks < ActiveRecord::Migration[6.0] + disable_ddl_transaction! + + class WebHook < ActiveRecord::Base + include EachBatch + + self.table_name = 'web_hooks' + end + + def up + WebHook.each_batch(of: 10_000, column: :id) do |relation| + relation.where(type: 'ProjectHook') + .where.not(project_id: nil) + .where.not(group_id: nil) + .update_all(group_id: nil) + end + end + + def down + # no-op + end +end diff --git a/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb b/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb new file mode 100644 index 00000000000..e7020665b25 --- /dev/null +++ b/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateForeignKeyOnGroupHooks < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + CONSTRAINT_NAME = 'fk_rails_d35697648e' + + def up + validate_foreign_key :web_hooks, :group_id, name: CONSTRAINT_NAME + end + + def down + # no-op + end +end diff --git a/db/migrate/20210429131525_create_user_credit_card_validations.rb b/db/migrate/20210429131525_create_user_credit_card_validations.rb new file mode 100644 index 00000000000..8548274b29a --- /dev/null +++ b/db/migrate/20210429131525_create_user_credit_card_validations.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class CreateUserCreditCardValidations < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + def up + with_lock_retries do + create_table :user_credit_card_validations, id: false do |t| + t.references :user, foreign_key: { on_delete: :cascade }, index: false, primary_key: true, default: nil + t.datetime_with_timezone :credit_card_validated_at, null: false + end + end + end + + def down + with_lock_retries do + drop_table :user_credit_card_validations + end + end +end diff --git a/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb b/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb new file mode 100644 index 00000000000..13b802f7cb4 --- /dev/null +++ b/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class ScheduleUpdateTimelogsProjectId < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + BATCH_SIZE = 50_000 + DELAY_INTERVAL = 2.minutes + MIGRATION = 'UpdateTimelogsProjectId' + + disable_ddl_transaction! + + class Timelog < ActiveRecord::Base + include EachBatch + + self.table_name = 'timelogs' + self.inheritance_column = :_type_disabled + end + + def up + queue_background_migration_jobs_by_range_at_intervals( + Timelog.all, + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + # no-op + end +end diff --git a/db/schema_migrations/20210427212034 b/db/schema_migrations/20210427212034 new file mode 100644 index 00000000000..4954b5722a9 --- /dev/null +++ b/db/schema_migrations/20210427212034 @@ -0,0 +1 @@ +2ffe65c4abcb8f638198943e1b74de710387438fb7c93addb05ccb3e86729934 \ No newline at end of file diff --git a/db/schema_migrations/20210428151144 b/db/schema_migrations/20210428151144 new file mode 100644 index 00000000000..53771dd9401 --- /dev/null +++ b/db/schema_migrations/20210428151144 @@ -0,0 +1 @@ +468373a97f7bd66197c81f01bebd27256cf96ec8fc226c5d73e579a7ecc3930d \ No newline at end of file diff --git a/db/schema_migrations/20210428151238 b/db/schema_migrations/20210428151238 new file mode 100644 index 00000000000..3fa6ecefc42 --- /dev/null +++ b/db/schema_migrations/20210428151238 @@ -0,0 +1 @@ +3244023441c2afa450ad76345a494975b4a7154892298daf1ec4223d27fb7ca3 \ No newline at end of file diff --git a/db/schema_migrations/20210429131525 b/db/schema_migrations/20210429131525 new file mode 100644 index 00000000000..4ab6b84eea9 --- /dev/null +++ b/db/schema_migrations/20210429131525 @@ -0,0 +1 @@ +68ac54fa7b4e4ef99e58c31d8f960b6f986fd679c11ead235704c7a75b4617ac \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index b237a7f526c..fce0a085dac 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -18282,6 +18282,11 @@ CREATE SEQUENCE user_canonical_emails_id_seq ALTER SEQUENCE user_canonical_emails_id_seq OWNED BY user_canonical_emails.id; +CREATE TABLE user_credit_card_validations ( + user_id bigint NOT NULL, + credit_card_validated_at timestamp with time zone NOT NULL +); + CREATE TABLE user_custom_attributes ( id integer NOT NULL, created_at timestamp without time zone NOT NULL, @@ -21655,6 +21660,9 @@ ALTER TABLE ONLY user_callouts ALTER TABLE ONLY user_canonical_emails ADD CONSTRAINT user_canonical_emails_pkey PRIMARY KEY (id); +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT user_credit_card_validations_pkey PRIMARY KEY (user_id); + ALTER TABLE ONLY user_custom_attributes ADD CONSTRAINT user_custom_attributes_pkey PRIMARY KEY (id); @@ -25941,6 +25949,9 @@ ALTER TABLE ONLY lfs_file_locks ALTER TABLE ONLY project_alerting_settings ADD CONSTRAINT fk_rails_27a84b407d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT fk_rails_27ebc03cbf FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_validations ADD CONSTRAINT fk_rails_285c617324 FOREIGN KEY (dast_site_token_id) REFERENCES dast_site_tokens(id) ON DELETE CASCADE; @@ -26923,7 +26934,7 @@ ALTER TABLE ONLY pool_repositories ADD CONSTRAINT fk_rails_d2711daad4 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; ALTER TABLE ONLY web_hooks - ADD CONSTRAINT fk_rails_d35697648e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE NOT VALID; + ADD CONSTRAINT fk_rails_d35697648e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY group_group_links ADD CONSTRAINT fk_rails_d3a0488427 FOREIGN KEY (shared_group_id) REFERENCES namespaces(id) ON DELETE CASCADE; diff --git a/doc/development/usage_ping/index.md b/doc/development/usage_ping/index.md index 0e12c620a8a..e79cd127d5a 100644 --- a/doc/development/usage_ping/index.md +++ b/doc/development/usage_ping/index.md @@ -635,11 +635,12 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd) and [PF - `category`: event category. Used for getting total counts for events in a category, for easier access to a group of events. - - `redis_slot`: optional Redis slot; default value: event name. Used if needed to calculate totals - for a group of metrics. Ensure keys are in the same slot. For example: + - `redis_slot`: optional Redis slot. Default value: event name. Only event data that is stored in the same slot + can be aggregated. Ensure keys are in the same slot. For example: `users_creating_epics` with `redis_slot: 'users'` builds Redis key `{users}_creating_epics-2020-34`. If `redis_slot` is not defined the Redis key will be `{users_creating_epics}-2020-34`. + Recommended slots to use are: `users`, `projects`. This is the value we count. - `expiry`: expiry time in days. Default: 29 days for daily aggregation and 6 weeks for weekly aggregation. - `aggregation`: may be set to a `:daily` or `:weekly` key. Defines how counting data is stored in Redis. diff --git a/lib/gitlab/background_migration/update_timelogs_project_id.rb b/lib/gitlab/background_migration/update_timelogs_project_id.rb new file mode 100644 index 00000000000..24c9967b88e --- /dev/null +++ b/lib/gitlab/background_migration/update_timelogs_project_id.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # Class to populate project_id for timelogs + class UpdateTimelogsProjectId + BATCH_SIZE = 1000 + + def perform(start_id, stop_id) + (start_id..stop_id).step(BATCH_SIZE).each do |offset| + update_issue_timelogs(offset, offset + BATCH_SIZE) + update_merge_request_timelogs(offset, offset + BATCH_SIZE) + end + end + + def update_issue_timelogs(batch_start, batch_stop) + execute(<<~SQL) + UPDATE timelogs + SET project_id = issues.project_id + FROM issues + WHERE issues.id = timelogs.issue_id + AND timelogs.id BETWEEN #{batch_start} AND #{batch_stop} + AND timelogs.project_id IS NULL; + SQL + end + + def update_merge_request_timelogs(batch_start, batch_stop) + execute(<<~SQL) + UPDATE timelogs + SET project_id = merge_requests.target_project_id + FROM merge_requests + WHERE merge_requests.id = timelogs.merge_request_id + AND timelogs.id BETWEEN #{batch_start} AND #{batch_stop} + AND timelogs.project_id IS NULL; + SQL + end + + def execute(sql) + @connection ||= ::ActiveRecord::Base.connection + @connection.execute(sql) + end + end + end +end diff --git a/lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml b/lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml index 3ebccfbba4a..b6f98d5034e 100644 --- a/lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml @@ -292,7 +292,7 @@ semgrep-sast: # SAST_ANALYZER_IMAGE is an undocumented variable used internally to allow QA to # override the analyzer image with a custom value. This may be subject to change or # breakage across GitLab releases. - SAST_ANALYZER_IMAGE: "$SECURE_ANALYZERS_PREFIX/semgrep:latest" + SAST_ANALYZER_IMAGE: "$SECURE_ANALYZERS_PREFIX/semgrep:$SAST_ANALYZER_IMAGE_TAG" rules: - if: $SAST_DISABLED when: never diff --git a/lib/security/ci_configuration/sast_build_action.rb b/lib/security/ci_configuration/sast_build_action.rb index c319fc1637d..d670d5054ae 100644 --- a/lib/security/ci_configuration/sast_build_action.rb +++ b/lib/security/ci_configuration/sast_build_action.rb @@ -3,7 +3,7 @@ module Security module CiConfiguration class SastBuildAction < BaseBuildAction - SAST_DEFAULT_ANALYZERS = 'bandit, brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan, phpcs-security-audit, pmd-apex, security-code-scan, sobelow, spotbugs' + SAST_DEFAULT_ANALYZERS = 'bandit, brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan, phpcs-security-audit, pmd-apex, security-code-scan, semgrep, sobelow, spotbugs' def initialize(auto_devops_enabled, params, existing_gitlab_ci_content) super(auto_devops_enabled, existing_gitlab_ci_content) diff --git a/spec/factories/ci/job_artifacts.rb b/spec/factories/ci/job_artifacts.rb index b1adbcd283b..17cd495e217 100644 --- a/spec/factories/ci/job_artifacts.rb +++ b/spec/factories/ci/job_artifacts.rb @@ -277,6 +277,16 @@ FactoryBot.define do end end + trait :sast_minimal do + file_type { :sast } + file_format { :raw } + + after(:build) do |artifact, _| + artifact.file = fixture_file_upload( + Rails.root.join('spec/fixtures/security_reports/master/gl-sast-report-minimal.json'), 'application/json') + end + end + trait :secret_detection do file_type { :secret_detection } file_format { :raw } diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 9b5e4a981a0..7ac44d55687 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -80,6 +80,12 @@ FactoryBot.define do last_sign_in_ip { '127.0.0.1' } end + trait :with_credit_card_validation do + after :create do |user| + create :credit_card_validation, user: user + end + end + trait :two_factor_via_otp do before(:create) do |user| user.otp_required_for_login = true diff --git a/spec/factories/users/credit_card_validations.rb b/spec/factories/users/credit_card_validations.rb new file mode 100644 index 00000000000..09940347708 --- /dev/null +++ b/spec/factories/users/credit_card_validations.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :credit_card_validation, class: 'Users::CreditCardValidation' do + user + + credit_card_validated_at { Time.current } + end +end diff --git a/spec/fixtures/security_reports/master/gl-sast-report-minimal.json b/spec/fixtures/security_reports/master/gl-sast-report-minimal.json new file mode 100644 index 00000000000..60a67453c9b --- /dev/null +++ b/spec/fixtures/security_reports/master/gl-sast-report-minimal.json @@ -0,0 +1,68 @@ +{ + "version": "14.0.0", + "vulnerabilities": [ + { + "category": "sast", + "name": "Cipher with no integrity", + "message": "Cipher with no integrity", + "cve": "groovy/src/main/java/com/gitlab/security_products/tests/App.groovy:29:CIPHER_INTEGRITY", + "severity": "Medium", + "confidence": "High", + "scanner": { + "id": "find_sec_bugs", + "name": "Find Security Bugs" + }, + "location": { + "file": "groovy/src/main/java/com/gitlab/security_products/tests/App.groovy", + "start_line": 29, + "end_line": 29, + "class": "com.gitlab.security_products.tests.App", + "method": "insecureCypher" + }, + "identifiers": [ + { + "type": "find_sec_bugs_type", + "name": "Find Security Bugs-CIPHER_INTEGRITY", + "value": "CIPHER_INTEGRITY", + "url": "https://find-sec-bugs.github.io/bugs.htm#CIPHER_INTEGRITY" + } + ], + "tracking": { + "type": "source", + "items": [ + { + "file": "groovy/src/main/java/com/gitlab/security_products/tests/App.groovy", + "start_line": 29, + "end_line": 29, + "signatures": [ + { + "algorithm": "hash", + "value": "HASHVALUE" + }, + { + "algorithm": "scope_offset", + "value": "groovy/src/main/java/com/gitlab/security_products/tests/App.groovy:App[0]:insecureCypher[0]:2" + } + ] + } + ] + } + } + ], + "remediations": [], + "scan": { + "scanner": { + "id": "find_sec_bugs", + "name": "Find Security Bugs", + "url": "https://spotbugs.github.io", + "vendor": { + "name": "GitLab" + }, + "version": "4.0.2" + }, + "type": "sast", + "status": "success", + "start_time": "placeholder-value", + "end_time": "placeholder-value" + } +} diff --git a/spec/fixtures/security_reports/master/gl-sast-report.json b/spec/fixtures/security_reports/master/gl-sast-report.json index 9da9fdc3832..3323c1fffe3 100644 --- a/spec/fixtures/security_reports/master/gl-sast-report.json +++ b/spec/fixtures/security_reports/master/gl-sast-report.json @@ -154,8 +154,8 @@ "items": [ { "file": "groovy/src/main/java/com/gitlab/security_products/tests/App.groovy", - "start_line": 47, - "end_line": 47, + "start_line": 29, + "end_line": 29, "signatures": [ { "algorithm": "hash", diff --git a/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js b/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js index d32e582e498..2832de98769 100644 --- a/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js +++ b/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js @@ -40,7 +40,7 @@ describe('AddContextCommitsModal', () => { store, propsData: { contextCommitsPath: '', - targetBranch: 'master', + targetBranch: 'main', mergeRequestIid: 1, projectId: 1, ...props, diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js index cb29dab86bf..139128e6d4a 100644 --- a/spec/frontend/api_spec.js +++ b/spec/frontend/api_spec.js @@ -930,7 +930,7 @@ describe('Api', () => { describe('createBranch', () => { it('creates new branch', (done) => { - const ref = 'master'; + const ref = 'main'; const branch = 'new-branch-name'; const dummyProjectPath = 'gitlab-org/gitlab-ce'; const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${encodeURIComponent( @@ -1262,7 +1262,7 @@ describe('Api', () => { )}/merge_requests`; const options = { source_branch: 'feature', - target_branch: 'master', + target_branch: 'main', title: 'Add feature', }; diff --git a/spec/frontend/code_navigation/components/app_spec.js b/spec/frontend/code_navigation/components/app_spec.js index ea389fa35c0..798f3bc0ee2 100644 --- a/spec/frontend/code_navigation/components/app_spec.js +++ b/spec/frontend/code_navigation/components/app_spec.js @@ -16,7 +16,7 @@ function factory(initialState = {}) { state: { ...createState(), ...initialState, - definitionPathPrefix: 'https://test.com/blob/master', + definitionPathPrefix: 'https://test.com/blob/main', }, actions: { fetchData, diff --git a/spec/frontend/code_navigation/store/mutations_spec.js b/spec/frontend/code_navigation/store/mutations_spec.js index d4a75da429e..cb10729f4b6 100644 --- a/spec/frontend/code_navigation/store/mutations_spec.js +++ b/spec/frontend/code_navigation/store/mutations_spec.js @@ -12,11 +12,11 @@ describe('Code navigation mutations', () => { it('sets initial data', () => { mutations.SET_INITIAL_DATA(state, { blobs: ['test'], - definitionPathPrefix: 'https://test.com/blob/master', + definitionPathPrefix: 'https://test.com/blob/main', }); expect(state.blobs).toEqual(['test']); - expect(state.definitionPathPrefix).toBe('https://test.com/blob/master'); + expect(state.definitionPathPrefix).toBe('https://test.com/blob/main'); }); }); diff --git a/spec/frontend/commits_spec.js b/spec/frontend/commits_spec.js index 954025091cf..8189ebe6e55 100644 --- a/spec/frontend/commits_spec.js +++ b/spec/frontend/commits_spec.js @@ -10,7 +10,7 @@ describe('Commits List', () => { beforeEach(() => { setFixtures(` -