Closing per discussion in #592798 (comment 3172099552), will start a new MR for updated approach
MR adds a new concern that has a web_url and web_path methods. This provides a standardized way for different parts of the application to generate web URLs and paths. Instead of each model calling the URL builder directly, they can now use simple web_url and web_path methods that work consistently across the codebase.
This is an initial iteration of this approach - the new concern is added to the Board and Commit models, and the code is updated to use the new web_url method instead of calling the URL builder directly. There are other outstanding models in lib/gitlab/url_builder.rb - to reduce MR size, they will be iterated in batches.
Related to #592798 and effort of https://gitlab.com/gitlab-com/gl-infra/software-delivery/operate/team-tasks/-/work_items/32+
[1] pry(main)> project = Project.first
=> #<Project id:1 toolbox/gitlab-smoke-tests>>
[2] pry(main)> commit = project.repository.commit('HEAD')
=> #<Commit id:79bb5a51635e3f22faf5035e58443a9f59a4ce73 toolbox/gitlab-smoke-tests@79bb5a51635e3f22faf5035e58443a9f59a4ce73>
[3] pry(main)> puts commit.web_url
http://127.0.0.1:3000/toolbox/gitlab-smoke-tests/-/commit/79bb5a51635e3f22faf5035e58443a9f59a4ce73
=> nil
[4] pry(main)> puts commit.web_path
/toolbox/gitlab-smoke-tests/-/commit/79bb5a51635e3f22faf5035e58443a9f59a4ce73
=> nil
http://localhost:3000/-/graphql-explorer, validate query against a public projectquery {
project(fullPath: "gitlab-org/gitlab-test") {
boards(first: 1) {
nodes {
id
name
webPath
webUrl
}
}
}
}
response
{
"data": {
"project": {
"boards": {
"nodes": [
{
"id": "gid://gitlab/Board/1",
"name": "Development",
"webPath": "/gitlab-org/gitlab-test/-/boards/1",
"webUrl": "http://127.0.0.1:3000/gitlab-org/gitlab-test/-/boards/1"
}
]
}
}
},
"correlationId": "01KKY38EXGCADRSSS094X4B3EB"
}
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Thanks for the clarification on this and reasoning behind this approach
LGTM, thanks
MR extends the AWS Terraform module to support custom security groups on all VM node types, not just gitlab-rails and monitor.
Changes:
custom_security_group_ids to apply additional Security Groups to all nodes, and *_custom_security_group_ids per-component equivalents for fine-grained control, following the existing custom_tags patterngitlab_rails_security_group_ids and monitor_security_group_ids in favour of the new *_custom_security_group_ids naming; existing values are still honoured unless the new variable is setenvironment_advanced_network.md
Closes #1223
When ready for review, the Author applies the workflowready for review label and mention @gitlab-org/software-delivery/get-maintainers:
Secret Detection and IaC Scan (SAST) jobs.Aaah, sorry for the miss. It was weird that only doc change was made
As I'm onboarding to this area, I relied on DAP and local GDK validation for the changes. So far created draft Draft: Initial standartization of web_url and w... (!227681 - closed) with initial changes, however I believe there's a blocker that affects current proposal implementation.
As part of the above MR and failing jobs there - https://gitlab.com/gitlab-org/gitlab/-/jobs/13529741666 and https://gitlab.com/gitlab-org/gitlab/-/jobs/13529999704. With further Duo help analysis it looks like the challenge is following:
GitLab has three parallel URL approaches in different levels:
Presenter::Base defines web_url and web_path (delegates to Gitlab::UrlBuilder)web_url methods such as Organization (direct call to Gitlab::UrlBuilder too)UrlBuilder usage - 200+ locations call Gitlab::UrlBuilder.build() directly (Serializers, Helpers, Views, Models, so on) - example snippet usage or custom commit_url usageApproach of concern addition to a model, like Commit, as done in !227681 (diffs) results in clash:
CommitPresenter inherits from Presenter::Delegated (uses SimpleDelegator)Presenter::Base already defines web_url and web_path
If models are SSOT for web ul/path and presenters should delegate to models - then to remove above failure would this require refactoring web_url/web_path from Presenter::Base? Then it will affect everything that inherits from it, massive refactor that I'm not seeing how can be broken down so far.