OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Also check static links for consistency
Jan Sandbrinkc000df32f135
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yamlindex 85171d8123a..ae765ec999b 100644--- a/.github/workflows/docs.yaml+++ b/.github/workflows/docs.yaml@@ -7,6 +7,7 @@ on:- release/*paths:- 'docs/**'+ - 'config/static_links.yml'permissions:contents: readdiff --git a/config/static_links.yml b/config/static_links.ymlnew file mode 100644index 00000000000..ea5a4788d15--- /dev/null+++ b/config/static_links.yml@@ -0,0 +1,176 @@+upsale:+ href: https://www.openproject.org/enterprise-edition+ label: homescreen.links.upgrade_enterprise_edition+upsale_benefits_features:+ href: https://www.openproject.org/enterprise-edition/#premium-features+ label: noscript_learn_more+upsale_benefits_installation:+ href: https://www.openproject.org/enterprise-edition/#installation+ label: noscript_learn_more+upsale_benefits_security:+ href: https://www.openproject.org/enterprise-edition/#security-features+ label: noscript_learn_more+upsale_benefits_support:+ href: https://www.openproject.org/enterprise-edition/#professional-support+ label: noscript_learn_more+upsale_get_quote:+ href: https://www.openproject.org/request-quote/+ label: admin.enterprise.get_quote+user_guides:+ href: https://www.openproject.org/docs/user-guide/+ label: homescreen.links.user_guides+installation_guides:+ href: https://www.openproject.org/docs/installation-and-operations/installation/+ label: :label_installation_guides+packager_installation:+ href: https://www.openproject.org/docs/installation-and-operations/installation/packaged/+ label: Packaged installation+docker_installation:+ href: https://www.openproject.org/docs/installation-and-operations/installation/docker/+ label: Docker installation+manual_installation:+ href: https://www.openproject.org/docs/installation-and-operations/installation/manual/+ label: Manual installation+upgrade_guides:+ href: https://www.openproject.org/docs/installation-and-operations/operation/upgrading/+ label: :label_upgrade_guides+postgres_migration:+ href: https://www.openproject.org/docs/installation-and-operations/misc/packaged-postgresql-migration/+ label: :homescreen.links.postgres_migration+postgres_13_upgrade:+ href: https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql13/+configuration_guide:+ href: https://www.openproject.org/docs/installation-and-operations/configuration/+ label: links.configuration_guide+contact:+ href: https://www.openproject.org/contact/+ label: links.get_in_touch+glossary:+ href: https://www.openproject.org/docs/glossary/+ label: homescreen.links.glossary+shortcuts:+ href: https://www.openproject.org/docs/user-guide/keyboard-shortcuts-access-keys/+ label: homescreen.links.shortcuts+forums:+ href: https://community.openproject.org/projects/openproject/forums+ label: homescreen.links.forums+enterprise_support_as_community:+ href: https://www.openproject.org/pricing/#support+ label: :label_enterprise_support+enterprise_support:+ href: https://www.openproject.org/docs/enterprise-guide/support/+ label: :label_enterprise_support+website:+ href: https://www.openproject.org+ label: label_openproject_website+newsletter:+ href: https://www.openproject.org/newsletter+ label: homescreen.links.newsletter+blog:+ href: https://www.openproject.org/blog+ label: homescreen.links.blog+blog_article_progress_changes:+ href: https://www.openproject.org/blog/updates-to-progress-tracking-in-14-4-based-on-user-feedback/+ label: Significant changes to progress and work estimates+release_notes:+ href: https://www.openproject.org/docs/release-notes/+ label: :label_release_notes+release_notes_14_0_1:+ href: https://www.openproject.org/docs/release-notes/14-0-1/+ label: Release notes for OpenProject 14.0.1+data_privacy:+ href: https://www.openproject.org/legal/privacy/+ label: :label_privacy_policy+digital_accessibility:+ href: https://www.openproject.org/de/rechtliches/erklaerung-zur-digitalen-barrierefreiheit/+ label: :label_digital_accessibility+report_bug:+ href: https://www.openproject.org/docs/development/report-a-bug/+ label: :label_report_bug+roadmap:+ href: https://community.openproject.org/projects/openproject/roadmap+ label: :label_development_roadmap+crowdin:+ href: https://www.openproject.org/docs/development/translate-openproject/+ label: :label_add_edit_translations+api_docs:+ href: https://www.openproject.org/docs/api/+ label: :label_api_doc+text_formatting:+ href: https://www.openproject.org/docs/user-guide/wysiwyg/+ label: :setting_text_formatting+oauth_authorization_code_flow:+ href: https://oauth.net/2/grant-types/authorization-code/+ label: oauth.flows.authorization_code+client_credentials_code_flow:+ href: https://oauth.net/2/grant-types/client-credentials/+ label: oauth.flows.client_credentials+ldap_encryption_documentation:+ href: https://www.rubydoc.info/gems/net-ldap/Net/LDAP#constructor_details+origin_mdn_documentation:+ href: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin+security_badge_documentation:+ href: https://www.openproject.org/docs/system-admin-guide/information/#security-badge+date_format_settings_documentation:+ href: https://www.openproject.org/docs/system-admin-guide/calendars-and-dates/#date-format+chargebee:+ href: https://js.chargebee.com/v2/chargebee.js+webinar_videos:+ href: https://www.youtube.com/watch?v=un6zCm8_FT4+get_started_videos:+ href: https://www.youtube.com/playlist?list=PLGzJ4gG7hPb8WWOWmeXqlfMfhdXReu-RJ+openproject_docs:+ href: https://www.openproject.org/docs/+contact_us:+ href: https://www.openproject.org/contact/+pricing:+ href: https://www.openproject.org/pricing/+progress_tracking_docs:+ href: https://www.openproject.org/docs/user-guide/time-and-costs/progress-tracking/+enterprise_docs:+ automatic_subject_generation:+ href: https://www.openproject.org/docs/system-admin-guide/manage-work-packages/work-package-types/#work-package-subject-configuration-enterprise-add-on+ form_configuration:+ href: https://www.openproject.org/docs/system-admin-guide/manage-work-packages/work-package-types/#work-package-form-configuration-enterprise-add-on+ attribute_highlighting:+ href: https://www.openproject.org/docs/user-guide/work-packages/work-package-table-configuration/#attribute-highlighting-enterprise-add-on+ boards:+ href: https://www.openproject.org/docs/user-guide/agile-boards/#action-boards-enterprise-add-on+ custom_field_projects:+ href: https://www.openproject.org/docs/system-admin-guide/custom-fields/custom-fields-projects/+ custom_field_multiselect:+ href: https://www.openproject.org/docs/system-admin-guide/custom-fields/#create-a-multi-select-custom-field+ status_read_only:+ href: https://www.openproject.org/docs/system-admin-guide/manage-work-packages/work-package-status/#create-a-new-work-package-status+ customize_life_cycle:+ href: https://www.openproject.org/enterprise-edition+sysadmin_docs:+ saml:+ href: https://www.openproject.org/docs/system-admin-guide/authentication/saml/+ oidc:+ href: https://www.openproject.org/docs/installation-and-operations/misc/custom-openid-connect-providers/+ oidc_claims:+ href: https://www.openproject.org/docs/installation-and-operations/misc/custom-openid-connect-providers/#claims+ oidc_acr_values:+ href: https://www.openproject.org/docs/installation-and-operations/misc/custom-openid-connect-providers/#non-essential-claims+storage_docs:+ setup:+ href: https://www.openproject.org/docs/system-admin-guide/integrations/storage/+ nextcloud_setup:+ href: https://www.openproject.org/docs/system-admin-guide/integrations/nextcloud/+ one_drive_setup:+ href: https://www.openproject.org/docs/system-admin-guide/integrations/one-drive/+ one_drive_drive_id_guide:+ href: https://www.openproject.org/docs/system-admin-guide/integrations/one-drive/drive-guide/+ nextcloud_oauth_application:+ href: https://apps.nextcloud.com/apps/integration_openproject+ one_drive_oauth_application:+ href: https://portal.azure.com/+ troubleshooting:+ href: https://www.openproject.org/docs/user-guide/file-management/nextcloud-integration/#possible-errors-and-troubleshooting+ health_status:+ href: https://www.openproject.org/docs/system-admin-guide/files/external-file-storages/health-status/+ical_docs:+ href: https://www.openproject.org/docs/user-guide/calendar/#subscribe-to-a-calendar+integrations:+ href: https://www.openproject.org/docs/system-admin-guide/integrations/diff --git a/lib/open_project/static/links.rb b/lib/open_project/static/links.rbindex 2bc843f35ea..0d0ad9d1f31 100644--- a/lib/open_project/static/links.rb+++ b/lib/open_project/static/links.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH@@ -73,256 +75,10 @@ module OpenProjectenddef static_links- {- upsale: {- href: "https://www.openproject.org/enterprise-edition",- label: "homescreen.links.upgrade_enterprise_edition"- },- upsale_benefits_features: {- href: "https://www.openproject.org/enterprise-edition/#premium-features",- label: "noscript_learn_more"- },- upsale_benefits_installation: {- href: "https://www.openproject.org/enterprise-edition/#installation",- label: "noscript_learn_more"- },- upsale_benefits_security: {- href: "https://www.openproject.org/enterprise-edition/#security-features",- label: "noscript_learn_more"- },- upsale_benefits_support: {- href: "https://www.openproject.org/enterprise-edition/#professional-support",- label: "noscript_learn_more"- },- upsale_get_quote: {- href: "https://www.openproject.org/request-quote/",- label: "admin.enterprise.get_quote"- },- user_guides: {- href: "https://www.openproject.org/docs/user-guide/",- label: "homescreen.links.user_guides"- },- installation_guides: {- href: "https://www.openproject.org/docs/installation-and-operations/installation/",- label: :label_installation_guides- },- packager_installation: {- href: "https://www.openproject.org/docs/installation-and-operations/installation/packaged/",- label: "Packaged installation"- },- docker_installation: {- href: "https://www.openproject.org/docs/installation-and-operations/installation/docker/",- label: "Docker installation"- },- manual_installation: {- href: "https://www.openproject.org/docs/installation-and-operations/installation/manual/",- label: "Manual installation"- },- upgrade_guides: {- href: "https://www.openproject.org/docs/installation-and-operations/operation/upgrading/",- label: :label_upgrade_guides- },- postgres_migration: {- href: "https://www.openproject.org/docs/installation-and-operations/misc/packaged-postgresql-migration/",- label: :"homescreen.links.postgres_migration"- },- postgres_13_upgrade: {- href: "https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql13/"- },- configuration_guide: {- href: "https://www.openproject.org/docs/installation-and-operations/configuration/",- label: "links.configuration_guide"- },- contact: {- href: "https://www.openproject.org/contact/",- label: "links.get_in_touch"- },- glossary: {- href: "https://www.openproject.org/docs/glossary/",- label: "homescreen.links.glossary"- },- shortcuts: {- href: "https://www.openproject.org/docs/user-guide/keyboard-shortcuts-access-keys/",- label: "homescreen.links.shortcuts"- },- forums: {- href: "https://community.openproject.org/projects/openproject/forums",- label: "homescreen.links.forums"- },- enterprise_support_as_community: {- href: "https://www.openproject.org/pricing/#support",- label: :label_enterprise_support- },- enterprise_support: {- href: "https://www.openproject.org/docs/enterprise-guide/support/",- label: :label_enterprise_support- },- website: {- href: "https://www.openproject.org",- label: "label_openproject_website"- },- newsletter: {- href: "https://www.openproject.org/newsletter",- label: "homescreen.links.newsletter"- },- blog: {- href: "https://www.openproject.org/blog",- label: "homescreen.links.blog"- },- blog_article_progress_changes: {- href: "https://www.openproject.org/blog/updates-to-progress-tracking-in-14-4-based-on-user-feedback/",- label: "Significant changes to progress and work estimates"- },- release_notes: {- href: "https://www.openproject.org/docs/release-notes/",- label: :label_release_notes- },- release_notes_14_0_1: {- href: "https://www.openproject.org/docs/release-notes/14-0-1/",- label: "Release notes for OpenProject 14.0.1"- },- data_privacy: {- href: "https://www.openproject.org/legal/privacy/",- label: :label_privacy_policy- },- digital_accessibility: {- href: "https://www.openproject.org/de/rechtliches/erklaerung-zur-digitalen-barrierefreiheit/",- label: :label_digital_accessibility- },- report_bug: {- href: "https://www.openproject.org/docs/development/report-a-bug/",- label: :label_report_bug- },- roadmap: {- href: "https://community.openproject.org/projects/openproject/roadmap",- label: :label_development_roadmap- },- crowdin: {- href: "https://www.openproject.org/docs/development/translate-openproject/",- label: :label_add_edit_translations- },- api_docs: {- href: "https://www.openproject.org/docs/api/",- label: :label_api_doc- },- text_formatting: {- href: "https://www.openproject.org/docs/user-guide/wysiwyg/",- label: :setting_text_formatting- },- oauth_authorization_code_flow: {- href: "https://oauth.net/2/grant-types/authorization-code/",- label: "oauth.flows.authorization_code"- },- client_credentials_code_flow: {- href: "https://oauth.net/2/grant-types/client-credentials/",- label: "oauth.flows.client_credentials"- },- ldap_encryption_documentation: {- href: "https://www.rubydoc.info/gems/net-ldap/Net/LDAP#constructor_details"- },- origin_mdn_documentation: {- href: "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin"- },- security_badge_documentation: {- href: "https://www.openproject.org/docs/system-admin-guide/information/#security-badge"- },- date_format_settings_documentation: {- href: "https://www.openproject.org/docs/system-admin-guide/calendars-and-dates/#date-format"- },- chargebee: {- href: "https://js.chargebee.com/v2/chargebee.js"- },- webinar_videos: {- href: "https://www.youtube.com/watch?v=un6zCm8_FT4"- },- get_started_videos: {- href: "https://www.youtube.com/playlist?list=PLGzJ4gG7hPb8WWOWmeXqlfMfhdXReu-RJ"- },- openproject_docs: {- href: "https://www.openproject.org/docs/"- },- contact_us: {- href: "https://www.openproject.org/contact/"- },- pricing: {- href: "https://www.openproject.org/pricing/"- },- progress_tracking_docs: {- href: "https://www.openproject.org/docs/user-guide/time-and-costs/progress-tracking/"- },- enterprise_docs: {- automatic_subject_generation: {- href: "https://www.openproject.org/docs/system-admin-guide/manage-work-packages/work-package-types/#work-package-subject-configuration-enterprise-add-on"- },- form_configuration: {- href: "https://www.openproject.org/docs/system-admin-guide/manage-work-packages/work-package-types/#work-package-form-configuration-enterprise-add-on"- },- attribute_highlighting: {- href: "https://www.openproject.org/docs/user-guide/work-packages/work-package-table-configuration/#attribute-highlighting-enterprise-add-on"- },- boards: {- href: "https://www.openproject.org/docs/user-guide/agile-boards/#action-boards-enterprise-add-on"- },- custom_field_projects: {- href: "https://www.openproject.org/docs/system-admin-guide/custom-fields/custom-fields-projects/"- },- custom_field_multiselect: {- href: "https://www.openproject.org/docs/system-admin-guide/custom-fields/#create-a-multi-select-custom-field"- },- status_read_only: {- href: "https://www.openproject.org/docs/system-admin-guide/manage-work-packages/work-package-status/#create-a-new-work-package-status"- },- customize_life_cycle: {- href: "https://www.openproject.org/enterprise-edition" # TODO: update- }- },- sysadmin_docs: {- saml: {- href: "https://www.openproject.org/docs/system-admin-guide/authentication/saml/"- },- oidc: {- href: "https://www.openproject.org/docs/installation-and-operations/misc/custom-openid-connect-providers/"- },- oidc_claims: {- href: "https://www.openproject.org/docs/installation-and-operations/misc/custom-openid-connect-providers/#claims"- },- oidc_acr_values: {- href: "https://www.openproject.org/docs/installation-and-operations/misc/custom-openid-connect-providers/#non-essential-claims"- }- },- storage_docs: {- setup: {- href: "https://www.openproject.org/docs/system-admin-guide/integrations/storage/"- },- nextcloud_setup: {- href: "https://www.openproject.org/docs/system-admin-guide/integrations/nextcloud/"- },- one_drive_setup: {- href: "https://www.openproject.org/docs/system-admin-guide/integrations/one-drive/"- },- one_drive_drive_id_guide: {- href: "https://www.openproject.org/docs/system-admin-guide/integrations/one-drive/drive-guide/"- },- nextcloud_oauth_application: {- href: "https://apps.nextcloud.com/apps/integration_openproject"- },- one_drive_oauth_application: {- href: "https://portal.azure.com/"- },- troubleshooting: {- href: "https://www.openproject.org/docs/user-guide/file-management/nextcloud-integration/#possible-errors-and-troubleshooting"- },- health_status: {- href: "https://www.openproject.org/docs/system-admin-guide/files/external-file-storages/health-status/"- }- },- ical_docs: {- href: "https://www.openproject.org/docs/user-guide/calendar/#subscribe-to-a-calendar"- },- integrations: {- href: "https://www.openproject.org/docs/system-admin-guide/integrations/"- }- }+ @static_links ||= begin+ yaml = Rails.root.join("config/static_links.yml").read+ YAML.safe_load(yaml, permitted_classes: [Symbol], symbolize_names: true)+ endendendenddiff --git a/script/docs/check_links b/script/docs/check_linksindex 553eab0878a..5577379862f 100755--- a/script/docs/check_links+++ b/script/docs/check_links@@ -1,4 +1,5 @@#!/usr/bin/env ruby+# frozen_string_literal: truerequire "pathname"require "yaml"@@ -54,7 +55,7 @@ class APIChecker# adds infos for api pages which are generated out of the OpenAPI specdef api_pages- filename = Pathname(@root_path).join("api/apiv3/openapi-spec.yml")+ filename = Pathname(@root_path).join("docs/api/apiv3/openapi-spec.yml")spec = YAML.load_file(filename)@operations = collect_operations_from_spec(spec)spec["tags"]@@ -71,18 +72,18 @@ class APICheckerdef introduction_page(spec, filename)anchors, links = parse_markdown(spec["info"]["description"])- { path: "#{@root_path}/api/introduction", anchors:, links:, filename: }+ { path: "#{@root_path}/docs/api/introduction", anchors:, links:, filename: }enddef markdown_page(path, destination)- filename = Pathname(@root_path).join(path).to_s+ filename = Pathname(@root_path).join("docs/#{path}").to_sanchors, links = parse_markdown(File.read(filename))- { path: "#{@root_path}/#{destination}", anchors:, links:, filename: }+ { path: "#{@root_path}/docs/#{destination}", anchors:, links:, filename: }enddef collect_operations_from_spec(spec)spec["paths"].map do |p|- path_obj_path = Pathname(@root_path).join("api/apiv3/", p[1]["$ref"])+ path_obj_path = Pathname(@root_path).join("docs/api/apiv3/", p[1]["$ref"])path_obj = YAML.load_file(path_obj_path)path_obj.keys.map { |key| path_obj[key] }end.flatten@@ -95,13 +96,13 @@ class APICheckerenddef api_page_by_tag(ref)- tag_source = Pathname(@root_path).join("api/apiv3", ref)+ tag_source = Pathname(@root_path).join("docs/api/apiv3", ref)tag = YAML.load_file(tag_source)anchors, links, id_gen = parse_markdown(tag["description"])anchors.concat(operation_ids_by_tag(tag, id_gen))tag_path = ActiveSupport::Inflector.parameterize(tag["name"])tag_path = "endpoints/#{tag_path}" unless PULLED_UP_TAG_PAGES.include?(tag_path)- { path: "#{@root_path}/api/#{tag_path}", anchors:, links:, filename: tag_source }+ { path: "#{@root_path}/docs/api/#{tag_path}", anchors:, links:, filename: tag_source }endend@@ -127,7 +128,7 @@ class DocsCheckerenddef scan- @docs = Dir.glob("#{@root_path}/**/README.md")+ @docs = Dir.glob("#{@root_path}/docs/**/README.md").reject { |filename| filename.include?("/api/") }.map { |filename| build_doc(filename) }end@@ -139,11 +140,11 @@ class DocsCheckerdef add_virtual_pages# these pages are added by the website from other sources@docs.push(- { path: "#{@root_path}/api/v3/spec.json", anchors: [], links: [] },- { path: "#{@root_path}/api/v3/spec.yml", anchors: [], links: [] },- { path: "#{@root_path}/installation-and-operations/installation/docker-compose", anchors: [], links: [] },- { path: "#{@root_path}/installation-and-operations/installation/helm-chart", anchors: [], links: [] },- { path: "#{@root_path}/development/translate-openproject/fair-language", anchors: [], links: [] }+ { path: "#{@root_path}/docs/api/v3/spec.json", anchors: [], links: [] },+ { path: "#{@root_path}/docs/api/v3/spec.yml", anchors: [], links: [] },+ { path: "#{@root_path}/docs/installation-and-operations/installation/docker-compose", anchors: [], links: [] },+ { path: "#{@root_path}/docs/installation-and-operations/installation/helm-chart", anchors: [], links: [] },+ { path: "#{@root_path}/docs/development/translate-openproject/fair-language", anchors: [], links: [] })end@@ -166,7 +167,7 @@ class DocsCheckerdef strip_external_link_to_doc(url, path)uri = URI(url)- full_path = File.expand_path(uri.path.sub("/docs", "."), @root_path)+ full_path = File.expand_path(uri.path.sub("/docs", "./docs"), @root_path)relative_url = Pathname.new(full_path).relative_path_from("#{path}/").to_sreturn "#{relative_url}/##{uri.fragment}" unless uri.fragment.nil?@@ -195,6 +196,7 @@ class DocsCheckerdef check@errors = []@docs.each { |doc| check_doc(doc) }+ static_links.each { |link| check_static_link(link) }enddef report@@ -210,6 +212,40 @@ class DocsCheckerputs "Done. No broken references found." if @errors.empty?end+ def static_links+ yaml = File.read("#{@root_path}/config/static_links.yml")+ link_map = YAML.safe_load(yaml, permitted_classes: [Symbol], symbolize_names: true)+ extract_urls(link_map).map do |url|+ {+ url:,+ pos: {+ start_line: (yaml.lines.find_index { |l| l.match?(/#{url}(?:\s|\z|["'])/) } || 0) + 1,+ start_column: 1+ },+ doc: { filename: "config/static_links.yml" }+ }+ end+ end++ def extract_urls(nested_links)+ nested_links.values.map do |h|+ next h[:href] if h.key?(:href)++ extract_urls(h)+ end.flatten+ end++ def check_static_link(link)+ uri = URI(link[:url])+ expected_path = File.expand_path(File.join(@root_path, uri.path))+ return if uri.host != "www.openproject.org"+ return unless uri.path.start_with?("/docs/") # for now we can only test doc links++ target_doc = @docs.find { |d| d[:path] == expected_path }++ @errors.push({ error: "Page", link:, doc: link[:doc] }) if target_doc.nil?+ end+def github_escape(str)str.gsub(/[%:\n\r]/, { "%" => "%25", "\n" => "%0A", "\r" => "%0D", ":" => "%3A" }).squeeze(" ")end@@ -243,5 +279,5 @@ class DocsCheckerendexit 1 unless DocsChecker.new(- File.expand_path("../../docs/", __dir__)+ File.expand_path("../../", __dir__)).run