From ae2c90b95a1a005b1cbe45f3256da70050dab85d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 3 Apr 2024 21:10:54 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- ...evelopment Workspaces Category - issue.md} | 29 ++++--- .../Web IDE Category - issue.md | 79 +++++++++++++++++++ .../blueprints/rapid_diffs/index.md | 18 +++++ doc/ci/testing/test_coverage_visualization.md | 2 - doc/development/secure_coding_guidelines.md | 14 +++- qa/qa/tools/ci/test_metrics.rb | 15 +++- qa/tasks/ci.rake | 5 -- 7 files changed, 144 insertions(+), 18 deletions(-) rename .gitlab/issue_templates/{Remote Development Group - issue.md => Remote Development Workspaces Category - issue.md} (76%) create mode 100644 .gitlab/issue_templates/Web IDE Category - issue.md diff --git a/.gitlab/issue_templates/Remote Development Group - issue.md b/.gitlab/issue_templates/Remote Development Workspaces Category - issue.md similarity index 76% rename from .gitlab/issue_templates/Remote Development Group - issue.md rename to .gitlab/issue_templates/Remote Development Workspaces Category - issue.md index 80e8f41b521..b127a2a92c0 100644 --- a/.gitlab/issue_templates/Remote Development Group - issue.md +++ b/.gitlab/issue_templates/Remote Development Workspaces Category - issue.md @@ -1,14 +1,22 @@ MR: Pending + + + +## Description + +TODO: Fill out (required) + +As a [user or stakeholder], I want [goal or objective] so that [reason or benefit]. + +[Provide any additional description here.] + +## Acceptance Criteria + +TODO: Fill out (required) +- [ ] [Describe what must be achieved to complete this issue.] +- [ ] [Describe another requirement needed to complete this issue.] +- [ ] [Add additional acceptance criteria as needed.] + +## Technical Requirements + +TODO: Fill out or delete (optional) +[If applicable, please list out any technical requirements for this feature/enhancement.] + +## Design Requirements + +TODO: Fill out or delete (optional) +[If applicable, please provide a link to the design specifications for this feature/enhancement.] + +## Impact Assessment + +TODO: Fill out or delete (optional) +[Please describe the impact this feature/enhancement will have on the user experience and/or the product as a whole.] + +## User Story + +TODO: Fill out or delete (optional) +[Provide a user story to illustrate the use case for this feature/enhancement. Include examples to help communicate the intended functionality.] + + +/label ~"Category:Web IDE" +/label ~"section::dev" +/label ~"devops::create" +/label ~"group::ide" + + +/label ~"type::feature" + +/label ~"feature::addition" + + +/label ~"rd-workflow::unprioritized" + + +/label ~"workflow::refinement" diff --git a/doc/architecture/blueprints/rapid_diffs/index.md b/doc/architecture/blueprints/rapid_diffs/index.md index 51e052697c8..0b7be64a08d 100644 --- a/doc/architecture/blueprints/rapid_diffs/index.md +++ b/doc/architecture/blueprints/rapid_diffs/index.md @@ -250,6 +250,24 @@ sequenceDiagram Gitaly ->> Back end: List of diffs ``` +###### Database + +```mermaid +sequenceDiagram + Back end ->> Database: What are the file paths for a known MR version? + Database ->> Back end: List of paths +``` + +###### Cache + +- Fresh render of a diff + +```mermaid +sequenceDiagram + Back end ->> Cache: Give me the diff template for scenario XYZ + Cache ->> Back end: Static template to render diff in scenario XYZ +``` + ### Accessibility Reusable Rapid Diffs should be displayed in a way that is compliant with [Web Content Accessibility Guidelines 2.1](https://www.w3.org/TR/WCAG21/) level AA for web-based content and [Authoring Tool Accessibility Guidelines 2.0](https://www.w3.org/TR/ATAG20/) level AA for user interface. diff --git a/doc/ci/testing/test_coverage_visualization.md b/doc/ci/testing/test_coverage_visualization.md index 537bb31d9f7..a1887b5ec32 100644 --- a/doc/ci/testing/test_coverage_visualization.md +++ b/doc/ci/testing/test_coverage_visualization.md @@ -287,7 +287,6 @@ run tests: script: - pip install pytest pytest-cov - pytest --cov --cov-report term --cov-report xml:coverage.xml - coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' artifacts: reports: coverage_report: @@ -354,7 +353,6 @@ run tests: - cd build - make test - gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR} - coverage: /^\s*lines:\s*\d+.\d+\%/ artifacts: name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA} expire_in: 2 days diff --git a/doc/development/secure_coding_guidelines.md b/doc/development/secure_coding_guidelines.md index 9c6427c3255..c5a9b93261e 100644 --- a/doc/development/secure_coding_guidelines.md +++ b/doc/development/secure_coding_guidelines.md @@ -155,6 +155,8 @@ Hardcoded regular expressions with backtracking issues: Consider the following example application, which defines a check using a regular expression. A user entering `user@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!.com` as the email on a form will hang the web server. ```ruby +# For ruby versions < 3.2.0 +# Press ctrl+c to terminate a hung process class Email < ApplicationRecord DOMAIN_MATCH = Regexp.new('([a-zA-Z0-9]+)+\.com') @@ -170,7 +172,17 @@ end ### Mitigation -#### Ruby +#### Ruby from 3.2.0 + +Ruby released [Regexp improvements against ReDoS in 3.2.0](https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/). ReDoS will no longer be an issue, with the exception of _"some kind of regular expressions, such as those including advanced features (e.g., back-references or look-around), or with a huge fixed number of repetitions"_. + +[Until GitLab enforces a global Regexp timeout](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145679) you should pass an explicit timeout parameter, particularly when using advanced features or a large number of repetitions. For example: + +```ruby +Regexp.new('^a*b?a*()\1$', timeout: 1) # timeout in seconds +``` + +#### Ruby before 3.2.0 GitLab has [`Gitlab::UntrustedRegexp`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/untrusted_regexp.rb) which internally uses the [`re2`](https://github.com/google/re2/wiki/Syntax) library. diff --git a/qa/qa/tools/ci/test_metrics.rb b/qa/qa/tools/ci/test_metrics.rb index 96df432374a..e0ae4eb754a 100644 --- a/qa/qa/tools/ci/test_metrics.rb +++ b/qa/qa/tools/ci/test_metrics.rb @@ -24,13 +24,26 @@ module QA return logger.warn("No files matched pattern '#{metrics_file_glob}'") if metrics_files.empty? logger.info("Exporting #{metrics_data.size} entries to influxdb") - influx_client.create_write_api.write(data: metrics_data, bucket: INFLUX_MAIN_TEST_METRICS_BUCKET) + influx_client + .create_write_api(write_options: write_options) + .write(data: metrics_data, bucket: INFLUX_MAIN_TEST_METRICS_BUCKET) end private attr_reader :metrics_file_glob + # Write options for influxdb + # + # @return [InfluxDB::WriteOptions] + def write_options + InfluxDB2::WriteOptions.new( + write_type: InfluxDB2::WriteType::BATCHING, + batch_size: 100, + max_retries: 3 + ) + end + # Metrics data files # # @return [Array] diff --git a/qa/tasks/ci.rake b/qa/tasks/ci.rake index 3dfad6a82fd..7b7a8b6d601 100644 --- a/qa/tasks/ci.rake +++ b/qa/tasks/ci.rake @@ -72,9 +72,4 @@ namespace :ci do QA::Tools::Ci::TestMetrics.export(args[:glob]) end - - desc "Get available QA environment variables" - task :env_var_name_list do - puts Gitlab::QA::Runtime::Env.variables.keys.join("\n") - end end