summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md17
-rw-r--r--app/models/project_services/chat_notification_service.rb19
-rw-r--r--app/presenters/blob_presenter.rb18
-rw-r--r--app/presenters/blobs/unfold_presenter.rb8
-rw-r--r--changelogs/unreleased/65152-unfolded-lines-perf-improvement.yml5
-rw-r--r--changelogs/unreleased/66066-dark-theme-style-for-expansion-on-mr-diffs.yml5
-rw-r--r--changelogs/unreleased/66803-fix-uploads-relative-link-filter.yml5
-rw-r--r--changelogs/unreleased/fe-fix-issuable-sidebar-icon-of-notification-disabled.yml5
-rw-r--r--changelogs/unreleased/sh-fix-nplusone-issues.yml5
-rw-r--r--changelogs/unreleased/sh-fix-piwik-template.yml5
-rw-r--r--changelogs/unreleased/sh-fix-snippet-visibility-api.yml5
-rw-r--r--changelogs/unreleased/sh-mermaid-8-2-6.yml5
-rw-r--r--changelogs/unreleased/sh-upgrade-mermaid-8-2-4.yml5
-rw-r--r--doc/development/documentation/index.md49
-rw-r--r--doc/user/application_security/index.md2
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_add_license.pngbin24247 -> 0 bytes
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.pngbin0 -> 14046 bytes
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.pngbin12115 -> 0 bytes
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.pngbin0 -> 16435 bytes
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_search.pngbin28237 -> 0 bytes
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.pngbin0 -> 26074 bytes
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_settings.pngbin44790 -> 0 bytes
-rw-r--r--doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.pngbin0 -> 14766 bytes
-rw-r--r--doc/user/application_security/license_compliance/index.md8
-rw-r--r--doc/user/application_security/sast/index.md15
-rw-r--r--lib/gitlab/database_importers/self_monitoring/project/create_service.rb40
-rw-r--r--locale/gitlab.pot26
-rw-r--r--spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb16
-rw-r--r--spec/presenters/blob_presenter_spec.rb14
29 files changed, 153 insertions, 124 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c4d238b2999..a432b091c7e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,23 @@
documentation](doc/development/changelog.md) for instructions on adding your own
entry.
+## 12.2.4
+
+### Fixed (7 changes)
+
+- Add syntax highlighting for line expansion. !31821
+- Fix issuable sidebar icon on notification disabled. !32134
+- Upgrade Mermaid to v8.2.4. !32186
+- Fix Piwik not working. !32234
+- Fix snippets API not working with visibility level. !32286
+- Fix upload URLs in Markdown for users without access to project repository. !32448
+- Update Mermaid to v8.2.6. !32502
+
+### Performance (1 change)
+
+- Fix N+1 Gitaly calls in /api/v4/projects/:id/issues. !32171
+
+
## 12.2.3
### Security (22 changes)
diff --git a/app/models/project_services/chat_notification_service.rb b/app/models/project_services/chat_notification_service.rb
index 7c9ecc6b821..cb75c89136e 100644
--- a/app/models/project_services/chat_notification_service.rb
+++ b/app/models/project_services/chat_notification_service.rb
@@ -5,17 +5,25 @@
class ChatNotificationService < Service
include ChatMessage
+ SUPPORTED_EVENTS = %w[
+ push issue confidential_issue merge_request note confidential_note
+ tag_push pipeline wiki_page deployment
+ ].freeze
+
+ EVENT_CHANNEL = proc { |event| "#{event}_channel" }
+
default_value_for :category, 'chat'
prop_accessor :webhook, :username, :channel
+
+ # Custom serialized properties initialization
+ prop_accessor(*SUPPORTED_EVENTS.map { |event| EVENT_CHANNEL[event] })
+
boolean_accessor :notify_only_broken_pipelines, :notify_only_default_branch
validates :webhook, presence: true, public_url: true, if: :activated?
def initialize_properties
- # Custom serialized properties initialization
- self.supported_events.each { |event| self.class.prop_accessor(event_channel_name(event)) }
-
if properties.nil?
self.properties = {}
self.notify_only_broken_pipelines = true
@@ -32,8 +40,7 @@ class ChatNotificationService < Service
end
def self.supported_events
- %w[push issue confidential_issue merge_request note confidential_note tag_push
- pipeline wiki_page deployment]
+ SUPPORTED_EVENTS
end
def fields
@@ -139,7 +146,7 @@ class ChatNotificationService < Service
end
def event_channel_name(event)
- "#{event}_channel"
+ EVENT_CHANNEL[event]
end
def project_name
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb
index 2cf3278d240..3a71d2b87f3 100644
--- a/app/presenters/blob_presenter.rb
+++ b/app/presenters/blob_presenter.rb
@@ -3,12 +3,12 @@
class BlobPresenter < Gitlab::View::Presenter::Delegated
presents :blob
- def highlight(plain: nil)
+ def highlight(to: nil, plain: nil)
load_all_blob_data
Gitlab::Highlight.highlight(
blob.path,
- blob.data,
+ limited_blob_data(to: to),
language: blob.language_from_gitattributes,
plain: plain
)
@@ -23,4 +23,18 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
def load_all_blob_data
blob.load_all_data! if blob.respond_to?(:load_all_data!)
end
+
+ def limited_blob_data(to: nil)
+ return blob.data if to.blank?
+
+ # Even though we don't need all the lines at the start of the file (e.g
+ # viewing the middle part of a file), they still need to be highlighted
+ # to ensure that the succeeding lines can be formatted correctly (e.g.
+ # multi-line comments).
+ all_lines[0..to - 1].join
+ end
+
+ def all_lines
+ @all_lines ||= blob.data.lines
+ end
end
diff --git a/app/presenters/blobs/unfold_presenter.rb b/app/presenters/blobs/unfold_presenter.rb
index a256dd05a4d..487c6fe0757 100644
--- a/app/presenters/blobs/unfold_presenter.rb
+++ b/app/presenters/blobs/unfold_presenter.rb
@@ -26,8 +26,6 @@ module Blobs
# so we can accurately show the rest of the diff when unfolding.
load_all_blob_data
- @all_lines = blob.data.lines
-
handle_full_or_end!
end
@@ -46,7 +44,7 @@ module Blobs
def lines
strong_memoize(:lines) do
- limit(highlight.lines).map(&:html_safe)
+ limit(highlight(to: to).lines).map(&:html_safe)
end
end
@@ -76,7 +74,7 @@ module Blobs
def all_lines_size
strong_memoize(:all_lines_size) do
- @all_lines.size
+ all_lines.size
end
end
@@ -101,7 +99,7 @@ module Blobs
def limited_blob_lines
strong_memoize(:limited_blob_lines) do
- limit(@all_lines)
+ limit(all_lines)
end
end
diff --git a/changelogs/unreleased/65152-unfolded-lines-perf-improvement.yml b/changelogs/unreleased/65152-unfolded-lines-perf-improvement.yml
new file mode 100644
index 00000000000..835ed037b83
--- /dev/null
+++ b/changelogs/unreleased/65152-unfolded-lines-perf-improvement.yml
@@ -0,0 +1,5 @@
+---
+title: Support selective highlighting of lines
+merge_request: 32514
+author:
+type: performance
diff --git a/changelogs/unreleased/66066-dark-theme-style-for-expansion-on-mr-diffs.yml b/changelogs/unreleased/66066-dark-theme-style-for-expansion-on-mr-diffs.yml
deleted file mode 100644
index 13607ae938a..00000000000
--- a/changelogs/unreleased/66066-dark-theme-style-for-expansion-on-mr-diffs.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Add syntax highlighting for line expansion
-merge_request: 31821
-author:
-type: fixed
diff --git a/changelogs/unreleased/66803-fix-uploads-relative-link-filter.yml b/changelogs/unreleased/66803-fix-uploads-relative-link-filter.yml
deleted file mode 100644
index 523e5c8c545..00000000000
--- a/changelogs/unreleased/66803-fix-uploads-relative-link-filter.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Fix upload URLs in Markdown for users without access to project repository
-merge_request: 32448
-author:
-type: fixed
diff --git a/changelogs/unreleased/fe-fix-issuable-sidebar-icon-of-notification-disabled.yml b/changelogs/unreleased/fe-fix-issuable-sidebar-icon-of-notification-disabled.yml
deleted file mode 100644
index 736e12ff694..00000000000
--- a/changelogs/unreleased/fe-fix-issuable-sidebar-icon-of-notification-disabled.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Fix issuable sidebar icon on notification disabled
-merge_request: 32134
-author:
-type: fixed
diff --git a/changelogs/unreleased/sh-fix-nplusone-issues.yml b/changelogs/unreleased/sh-fix-nplusone-issues.yml
deleted file mode 100644
index f749b5eeb40..00000000000
--- a/changelogs/unreleased/sh-fix-nplusone-issues.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Fix N+1 Gitaly calls in /api/v4/projects/:id/issues
-merge_request: 32171
-author:
-type: performance
diff --git a/changelogs/unreleased/sh-fix-piwik-template.yml b/changelogs/unreleased/sh-fix-piwik-template.yml
deleted file mode 100644
index f0baed6a2e0..00000000000
--- a/changelogs/unreleased/sh-fix-piwik-template.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Fix Piwik not working
-merge_request: 32234
-author:
-type: fixed
diff --git a/changelogs/unreleased/sh-fix-snippet-visibility-api.yml b/changelogs/unreleased/sh-fix-snippet-visibility-api.yml
deleted file mode 100644
index 5cfb9cdedc0..00000000000
--- a/changelogs/unreleased/sh-fix-snippet-visibility-api.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Fix snippets API not working with visibility level
-merge_request: 32286
-author:
-type: fixed
diff --git a/changelogs/unreleased/sh-mermaid-8-2-6.yml b/changelogs/unreleased/sh-mermaid-8-2-6.yml
deleted file mode 100644
index d5cee250385..00000000000
--- a/changelogs/unreleased/sh-mermaid-8-2-6.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Update Mermaid to v8.2.6
-merge_request: 32502
-author:
-type: fixed
diff --git a/changelogs/unreleased/sh-upgrade-mermaid-8-2-4.yml b/changelogs/unreleased/sh-upgrade-mermaid-8-2-4.yml
deleted file mode 100644
index bdb64e43ecf..00000000000
--- a/changelogs/unreleased/sh-upgrade-mermaid-8-2-4.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Upgrade Mermaid to v8.2.4
-merge_request: 32186
-author:
-type: fixed
diff --git a/doc/development/documentation/index.md b/doc/development/documentation/index.md
index edd83f67d3b..719b9aa212a 100644
--- a/doc/development/documentation/index.md
+++ b/doc/development/documentation/index.md
@@ -4,9 +4,9 @@ description: Learn how to contribute to GitLab Documentation.
# GitLab Documentation guidelines
-GitLab's documentation is [intended as the single source of truth (SSOT)](https://about.gitlab.com/handbook/documentation/) for information about how to configure, use, and troubleshoot GitLab. The documentation contains use cases and usage instructions covering every GitLab feature, organized by product area and subject. This includes topics and workflows that span multiple GitLab features, as well as the use of GitLab with other applications.
+GitLab's documentation is [intended as the single source of truth (SSOT)](https://about.gitlab.com/handbook/documentation/) for information about how to configure, use, and troubleshoot GitLab. The documentation contains use cases and usage instructions for every GitLab feature, organized by product area and subject. This includes topics and workflows that span multiple GitLab features, and the use of GitLab with other applications.
-In addition to this page, the following resources to help craft and contribute documentation are available:
+In addition to this page, the following resources can help you craft and contribute documentation:
- [Style Guide](styleguide.md) - What belongs in the docs, language guidelines, and more.
- [Structure and template](structure.md) - Learn the typical parts of a doc page and how to write each one.
@@ -18,9 +18,9 @@ In addition to this page, the following resources to help craft and contribute d
## Source files and rendered web locations
-Documentation for GitLab Community Edition (CE) and Enterprise Edition (EE), along with GitLab Runner and Omnibus, is published to [docs.gitlab.com](https://docs.gitlab.com). The documentation for CE and EE is also published within the application at `/help` on the domain of the GitLab instance, though there are [plans](https://gitlab.com/groups/gitlab-org/-/epics/693) to end this practice and instead link out from the GitLab application to docs.gitlab.com URLs.
+Documentation for GitLab Community Edition (CE), Enterprise Edition (EE), GitLab Runner, and Omnibus is published to [docs.gitlab.com](https://docs.gitlab.com). Documentation for CE and EE is also published within the application at `/help` on the domain of the GitLab instance.
-At `/help`, only content for your current edition and version is included, whereas multiple versions' content is available at docs.gitlab.com.
+At `/help`, only help for your current edition and version is included. Help for other versions is available at docs.gitlab.com.
The source of the documentation exists within the codebase of each GitLab application in the following repository locations:
@@ -37,9 +37,9 @@ Documentation issues and merge requests are part of their respective repositorie
[Contributions to GitLab docs](workflow.md) are welcome from the entire GitLab community.
-To ensure that GitLab docs keep up with changes to the product, special processes and responsibilities are in place concerning all [feature changes](feature-change-workflow.md)—i.e. development work that impacts the appearance, usage, or administration of a feature.
+To ensure that GitLab docs are current, there are special processes and responsibilities for all [feature changes](feature-change-workflow.md)—i.e. development work that impacts the appearance, usage, or administration of a feature.
-Meanwhile, anyone can contribute [documentation improvements](improvement-workflow.md) large or small that are not associated with a feature change. For example, adding a new doc on how to accomplish a use case that's already possible with GitLab or with third-party tools and GitLab.
+However, anyone can contribute [documentation improvements](improvement-workflow.md) that are not associated with a feature change. For example, adding a new doc on how to accomplish a use case that's already possible with GitLab or with third-party tools and GitLab.
## Markdown and styles
@@ -54,16 +54,14 @@ See the [Structure](styleguide.md#structure) section of the [Documentation Style
## Single codebase
-We currently maintain two sets of docs: one in the
+We maintain two sets of docs: one in the
[gitlab-ce](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc) repo and
one in [gitlab-ee](https://gitlab.com/gitlab-org/gitlab-ee/tree/master/doc).
-They are identical, but they are different repositories. When the
-time comes to have only one codebase for the GitLab project, we'll be ready.
+These are identical, but they are different repositories.
### CE first
-All merge requests for documentation must be submitted to CE, regardless of the content
-it has. This means that:
+All merge requests for documentation must be submitted to CE. This means that:
- For **EE-only docs changes**, you only have to submit an MR in the CE project.
- For **EE-only features** that touch both the code and the docs, you have to submit
@@ -74,20 +72,20 @@ This might seem like a duplicate effort, but it's only for the short term.
Since the CE and EE docs are combined, it's crucial to add the relevant
[product badges](styleguide.md#product-badges) for all EE documentation, so that
-we can discern which features belong to which tier.
+we can determine which features belong to which tier.
### EE specific lines check
There's a special test in place
([`ee_specific_check.rb`](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/scripts/ee_specific_check/ee_specific_check.rb)),
-which, among others, checks and prevents creating/editing new files and directories
+which checks and prevents creating or editing new files or directories
in EE under `doc/`. This should fail when changes to anything in `/doc` are submitted
in an EE MR. To pass the test, simply remove the docs changes from the EE MR, and
[submit them in CE](#ce-first).
## Changing document location
-Changing a document's location requires specific steps to be followed to ensure that
+Changing a document's location requires specific steps to ensure that
users can seamlessly access the new doc page, whether they are accessing content
on a GitLab instance domain at `/help` or at docs.gitlab.com. Be sure to ping a
GitLab technical writer if you have any questions during the process (such as
@@ -95,7 +93,7 @@ whether the move is necessary), and ensure that a technical writer reviews this
change prior to merging.
If you indeed need to change a document's location, do not remove the old
-document, but rather replace all of its content with a new line:
+document, but instead replace all of its content with a new line:
```md
This document was moved to [another location](path/to/new_doc.md).
@@ -105,7 +103,7 @@ where `path/to/new_doc.md` is the relative path to the root directory `doc/`.
---
-For example, if you were to move `doc/workflow/lfs/lfs_administration.md` to
+For example, if you move `doc/workflow/lfs/lfs_administration.md` to
`doc/administration/lfs.md`, then the steps would be:
1. Copy `doc/workflow/lfs/lfs_administration.md` to `doc/administration/lfs.md`
@@ -145,7 +143,7 @@ Things to note:
### Alternative redirection method
-Alternatively to the method described above, you can simply replace the content
+You can also replace the content
of the old file with a frontmatter containing a redirect link:
```yaml
@@ -163,7 +161,7 @@ land on the doc via `/help`.
### Redirections for pages with Disqus comments
-If the documentation page being relocated already has any Disqus comments,
+If the documentation page being relocated already has Disqus comments,
we need to preserve the Disqus thread.
Disqus uses an identifier per page, and for docs.gitlab.com, the page identifier
@@ -189,8 +187,7 @@ even if it's `index.html` or `README.html`.
## Branch naming
If your contribution contains **only** documentation changes, you can speed up
-the CI process by following some branch naming conventions. You have three
-choices:
+the CI process by following these branch naming conventions:
| Branch name | Valid example |
|:----------------------|:-----------------------------|
@@ -199,7 +196,7 @@ choices:
| Ending in `-docs` | `123-update-api-issues-docs` |
If your branch name matches any of the above, it will run only the docs
-tests. If it does not, the whole application test suite will run (including docs tests).
+tests. If not, the whole application test suite will run (including docs tests).
## Merge requests for GitLab documentation
@@ -399,8 +396,8 @@ preview the changes. The docs URL can be found in two places:
triggered pipeline so that you can investigate whether something went wrong
TIP: **Tip:**
-Someone that has no merge rights to the CE/EE projects (think of forks from
-contributors) will not be able to run the manual job. In that case, you can
+Someone with no merge rights to the CE/EE projects (think of forks from
+contributors) cannot run the manual job. In that case, you can
ask someone from the GitLab team who has the permissions to do that for you.
NOTE: **Note:**
@@ -458,8 +455,8 @@ The following GitLab features are used among others:
## Testing
-We treat documentation as code, thus have implemented some testing.
-Currently, the following tests are in place:
+We treat documentation as code, and so use tests to maintain the standards and quality of the docs.
+The current tests are:
1. `docs lint`: Check that all internal (relative) links work correctly and
that all cURL examples in API docs use the full switches. It's recommended
@@ -484,7 +481,7 @@ Currently, the following tests are in place:
### Linting
-To help adhere to the [documentation style guidelines](styleguide.md), and to improve the content
+To help adhere to the [documentation style guidelines](styleguide.md), and improve the content
added to documentation, consider locally installing and running documentation linters. This will
help you catch common issues before raising merge requests for review of documentation.
diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md
index 5a1cc0561fc..69529d7420b 100644
--- a/doc/user/application_security/index.md
+++ b/doc/user/application_security/index.md
@@ -28,7 +28,7 @@ GitLab can scan and report any vulnerabilities found in your project.
| [Dependency List](dependency_list/index.md) **(ULTIMATE)** | View your project's dependencies and their known vulnerabilities. |
| [Dependency Scanning](dependency_scanning/index.md) **(ULTIMATE)** | Analyze your dependencies for known vulnerabilities. |
| [Dynamic Application Security Testing (DAST)](dast/index.md) **(ULTIMATE)** | Analyze running web applications for known vulnerabilities. |
-| [License Compliance](license_management/index.md) **(ULTIMATE)** | Search your project's dependencies for their licenses. |
+| [License Compliance](license_compliance/index.md) **(ULTIMATE)** | Search your project's dependencies for their licenses. |
| [Security Dashboard](security_dashboard/index.md) **(ULTIMATE)** | View vulnerabilities in all your projects and groups. |
| [Static Application Security Testing (SAST)](sast/index.md) **(ULTIMATE)** | Analyze source code for known vulnerabilities. |
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_add_license.png b/doc/user/application_security/license_compliance/img/license_compliance_add_license.png
deleted file mode 100644
index c9a5dc14c57..00000000000
--- a/doc/user/application_security/license_compliance/img/license_compliance_add_license.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png
new file mode 100644
index 00000000000..79f6160e63f
--- /dev/null
+++ b/doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png
Binary files differ
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png b/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png
deleted file mode 100644
index 80ffca815b9..00000000000
--- a/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png
new file mode 100644
index 00000000000..fd519d63b3e
--- /dev/null
+++ b/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png
Binary files differ
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_search.png b/doc/user/application_security/license_compliance/img/license_compliance_search.png
deleted file mode 100644
index b3ffd8d95a1..00000000000
--- a/doc/user/application_security/license_compliance/img/license_compliance_search.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png
new file mode 100644
index 00000000000..4a7cff2e85c
--- /dev/null
+++ b/doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png
Binary files differ
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_settings.png b/doc/user/application_security/license_compliance/img/license_compliance_settings.png
deleted file mode 100644
index 2e3e8888e93..00000000000
--- a/doc/user/application_security/license_compliance/img/license_compliance_settings.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png
new file mode 100644
index 00000000000..72d0888a9dc
--- /dev/null
+++ b/doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png
Binary files differ
diff --git a/doc/user/application_security/license_compliance/index.md b/doc/user/application_security/license_compliance/index.md
index f74b958cf67..6de1db8650d 100644
--- a/doc/user/application_security/license_compliance/index.md
+++ b/doc/user/application_security/license_compliance/index.md
@@ -198,7 +198,7 @@ To approve or blacklist a license:
**License Compliance** section.
1. Click the **Add a license** button.
- ![License Compliance Add License](img/license_compliance_add_license.png)
+ ![License Compliance Add License](img/license_compliance_add_license_v12_3.png)
1. In the **License name** dropdown, either:
- Select one of the available licenses. You can search for licenses in the field
@@ -212,13 +212,13 @@ To modify an existing license:
1. In the **License Compliance** list, click the **Approved/Declined** dropdown to change it to the desired status.
- ![License Compliance Settings](img/license_compliance_settings.png)
+ ![License Compliance Settings](img/license_compliance_settings_v12_3.png)
Searching for Licenses:
1. Use the **Search** box to search for a specific license.
- ![License Compliance Search](img/license_compliance_search.png)
+ ![License Compliance Search](img/license_compliance_search_v12_3.png)
## License Compliance report under pipelines
@@ -228,7 +228,7 @@ From your project's left sidebar, navigate to **CI/CD > Pipelines** and click on
pipeline ID that has a `license_management` job to see the Licenses tab with the listed
licenses (if any).
-![License Compliance Pipeline Tab](img/license_compliance_pipeline_tab.png)
+![License Compliance Pipeline Tab](img/license_compliance_pipeline_tab_v12_3.png)
<!-- ## Troubleshooting
diff --git a/doc/user/application_security/sast/index.md b/doc/user/application_security/sast/index.md
index 3eead6ccd3f..5e7bc4142fb 100644
--- a/doc/user/application_security/sast/index.md
+++ b/doc/user/application_security/sast/index.md
@@ -125,6 +125,21 @@ variables:
Because the template is [evaluated before](../../../ci/yaml/README.md#include)
the pipeline configuration, the last mention of the variable will take precedence.
+#### Using a variable to pass username and password to a private Maven repository
+
+If you have a private Apache Maven repository that requires login credentials,
+you can use the `MAVEN_CLI_OPTS` [environment variable](#available-variables)
+to pass a username and password. You can set it under your project's settings
+so that your credentials aren't exposed in `.gitlab-ci.yml`.
+
+If the username is `myuser` and the password is `verysecret` then you would
+set the following [variable](../../../ci/variables/README.md#via-the-ui)
+under your project's settings:
+
+| Type | Key | Value |
+| ---- | --- | ----- |
+| Variable | `MAVEN_CLI_OPTS` | `-Drepository.password=verysecret -Drepository.user=myuser` |
+
### Overriding the SAST template
If you want to override the job definition (for example, change properties like
diff --git a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
index 3a170e8b5f8..5422a8631a0 100644
--- a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
+++ b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
@@ -45,20 +45,20 @@ module Gitlab
def validate_application_settings
return success if application_settings
- log_error(_('No application_settings found'))
+ log_error('No application_settings found')
error(_('No application_settings found'))
end
def validate_project_created
return success unless project_created?
- log_error(_('Project already created'))
+ log_error('Project already created')
error(_('Project already created'))
end
def validate_admins
unless instance_admins.any?
- log_error(_('No active admin user found'))
+ log_error('No active admin user found')
return error(_('No active admin user found'))
end
@@ -83,7 +83,7 @@ module Gitlab
def create_project
if project_created?
- log_info(_('Instance administration project already exists'))
+ log_info('Instance administration project already exists')
@project = application_settings.instance_administration_project
return success(project: project)
end
@@ -93,7 +93,7 @@ module Gitlab
if project.persisted?
success(project: project)
else
- log_error(_("Could not create instance administration project. Errors: %{errors}") % { errors: project.errors.full_messages })
+ log_error("Could not create instance administration project. Errors: %{errors}" % { errors: project.errors.full_messages })
error(_('Could not create project'))
end
end
@@ -106,7 +106,7 @@ module Gitlab
if result
success
else
- log_error(_("Could not save instance administration project ID, errors: %{errors}") % { errors: application_settings.errors.full_messages })
+ log_error("Could not save instance administration project ID, errors: %{errors}" % { errors: application_settings.errors.full_messages })
error(_('Could not save project ID'))
end
end
@@ -116,7 +116,7 @@ module Gitlab
errors = members.flat_map { |member| member.errors.full_messages }
if errors.any?
- log_error(_('Could not add admins as members to self-monitoring project. Errors: %{errors}') % { errors: errors })
+ log_error('Could not add admins as members to self-monitoring project. Errors: %{errors}' % { errors: errors })
error(_('Could not add admins as members'))
else
success
@@ -128,7 +128,7 @@ module Gitlab
return success unless prometheus_listen_address.present?
uri = parse_url(internal_prometheus_listen_address_uri)
- return error(_('Prometheus listen_address is not a valid URI')) unless uri
+ return error(_('Prometheus listen_address in config/gitlab.yml is not a valid URI')) unless uri
application_settings.add_to_outbound_local_requests_whitelist([uri.normalized_host])
result = application_settings.save
@@ -140,7 +140,7 @@ module Gitlab
Gitlab::CurrentSettings.expire_current_application_settings
success
else
- log_error(_("Could not add prometheus URL to whitelist, errors: %{errors}") % { errors: application_settings.errors.full_messages })
+ log_error("Could not add prometheus URL to whitelist, errors: %{errors}" % { errors: application_settings.errors.full_messages })
error(_('Could not add prometheus URL to whitelist'))
end
end
@@ -152,7 +152,7 @@ module Gitlab
service = project.find_or_initialize_service('prometheus')
unless service.update(prometheus_service_attributes)
- log_error(_('Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}') % { errors: service.errors.full_messages })
+ log_error('Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}' % { errors: service.errors.full_messages })
return error(_('Could not save prometheus manual configuration'))
end
@@ -175,15 +175,15 @@ module Gitlab
def prometheus_enabled?
Gitlab.config.prometheus.enable if Gitlab.config.prometheus
rescue Settingslogic::MissingSetting
- log_error(_('prometheus.enable is not present in gitlab.yml'))
+ log_error('prometheus.enable is not present in config/gitlab.yml')
false
end
def prometheus_listen_address
- Gitlab.config.prometheus.listen_address if Gitlab.config.prometheus
+ Gitlab.config.prometheus.listen_address.to_s if Gitlab.config.prometheus
rescue Settingslogic::MissingSetting
- log_error(_('prometheus.listen_address is not present in gitlab.yml'))
+ log_error('Prometheus listen_address is not present in config/gitlab.yml')
nil
end
@@ -228,9 +228,21 @@ module Gitlab
end
def internal_prometheus_listen_address_uri
- if prometheus_listen_address.starts_with?('http')
+ if prometheus_listen_address.starts_with?('0.0.0.0:')
+ # 0.0.0.0:9090
+ port = ':' + prometheus_listen_address.split(':').second
+ 'http://localhost' + port
+
+ elsif prometheus_listen_address.starts_with?(':')
+ # :9090
+ 'http://localhost' + prometheus_listen_address
+
+ elsif prometheus_listen_address.starts_with?('http')
+ # https://localhost:9090
prometheus_listen_address
+
else
+ # localhost:9090
'http://' + prometheus_listen_address
end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index e91061e74c2..a1836646b1a 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -3374,15 +3374,9 @@ msgstr ""
msgid "Could not add admins as members"
msgstr ""
-msgid "Could not add admins as members to self-monitoring project. Errors: %{errors}"
-msgstr ""
-
msgid "Could not add prometheus URL to whitelist"
msgstr ""
-msgid "Could not add prometheus URL to whitelist, errors: %{errors}"
-msgstr ""
-
msgid "Could not authorize chat nickname. Try again!"
msgstr ""
@@ -3398,9 +3392,6 @@ msgstr ""
msgid "Could not create group"
msgstr ""
-msgid "Could not create instance administration project. Errors: %{errors}"
-msgstr ""
-
msgid "Could not create project"
msgstr ""
@@ -3419,18 +3410,12 @@ msgstr ""
msgid "Could not revoke personal access token %{personal_access_token_name}."
msgstr ""
-msgid "Could not save instance administration project ID, errors: %{errors}"
-msgstr ""
-
msgid "Could not save project ID"
msgstr ""
msgid "Could not save prometheus manual configuration"
msgstr ""
-msgid "Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}"
-msgstr ""
-
msgid "Coverage"
msgstr ""
@@ -6098,9 +6083,6 @@ msgstr ""
msgid "Instance Statistics visibility"
msgstr ""
-msgid "Instance administration project already exists"
-msgstr ""
-
msgid "Instance administrators group already exists"
msgstr ""
@@ -9202,7 +9184,7 @@ msgstr ""
msgid "ProjectsNew|Want to house several dependent projects under the same namespace? %{link_start}Create a group.%{link_end}"
msgstr ""
-msgid "Prometheus listen_address is not a valid URI"
+msgid "Prometheus listen_address in config/gitlab.yml is not a valid URI"
msgstr ""
msgid "PrometheusService|%{exporters} with %{metrics} were found"
@@ -14177,12 +14159,6 @@ msgstr ""
msgid "project avatar"
msgstr ""
-msgid "prometheus.enable is not present in gitlab.yml"
-msgstr ""
-
-msgid "prometheus.listen_address is not present in gitlab.yml"
-msgstr ""
-
msgid "quick actions"
msgstr ""
diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
index b3dedfe1f77..aab6fbcbbd1 100644
--- a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
+++ b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
@@ -176,14 +176,28 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
end
context 'with non default prometheus address' do
+ let(:listen_address) { 'https://localhost:9090' }
+
let(:prometheus_settings) do
{
enable: true,
- listen_address: 'https://localhost:9090'
+ listen_address: listen_address
}
end
it_behaves_like 'has prometheus service', 'https://localhost:9090'
+
+ context 'with :9090 symbol' do
+ let(:listen_address) { :':9090' }
+
+ it_behaves_like 'has prometheus service', 'http://localhost:9090'
+ end
+
+ context 'with 0.0.0.0:9090' do
+ let(:listen_address) { '0.0.0.0:9090' }
+
+ it_behaves_like 'has prometheus service', 'http://localhost:9090'
+ end
end
context 'when prometheus setting is not present in gitlab.yml' do
diff --git a/spec/presenters/blob_presenter_spec.rb b/spec/presenters/blob_presenter_spec.rb
index eacf383be7d..8680e8b9b45 100644
--- a/spec/presenters/blob_presenter_spec.rb
+++ b/spec/presenters/blob_presenter_spec.rb
@@ -39,6 +39,20 @@ describe BlobPresenter, :seed_helper do
subject.highlight(plain: true)
end
+ context '"to" param is present' do
+ before do
+ allow(git_blob)
+ .to receive(:data)
+ .and_return("line one\nline two\nline 3")
+ end
+
+ it 'returns limited highlighted content' do
+ expect(Gitlab::Highlight).to receive(:highlight).with('files/ruby/regex.rb', "line one\n", plain: nil, language: nil)
+
+ subject.highlight(to: 1)
+ end
+ end
+
context 'gitlab-language contains a match' do
before do
allow(blob).to receive(:language_from_gitattributes).and_return('ruby')