Compare commits

..

39 Commits

Author SHA1 Message Date
3a84eaeec0 Index Tool for Search
Some checks are pending
gl/check check status: pending (3a84eaeec0347fa1bee7e0f4cbe62ee2684aa209)
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-06-27 07:57:25 +00:00
7b247f1e70 Update 'otc_metadata/templates/conf.py.j2'
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-06-13 10:03:28 +00:00
f9a83705e1 Added function for search listing
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-06-13 08:15:04 +00:00
229823f93e enabling WAFD on public portal
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-06-13 08:06:51 +00:00
c39be95a60 fixing wrong team for dcs
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: vladimirhasko <vladimirhasko@gmail.com>
Co-committed-by: vladimirhasko <vladimirhasko@gmail.com>
2023-06-08 19:44:38 +00:00
677c98dc0f Fixing missing required approvals in generate script for gitcontrol
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-06-08 18:23:33 +00:00
036fbe3062 dli_public_enable
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-06-05 11:50:52 +00:00
dee14208f6 removing public images from internal location
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-06-02 15:07:44 +00:00
16a45b69d9 activate sbv for vpn service
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-06-02 11:07:14 +00:00
94dadbd764 From 1.June Swift become deprecated service
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Muller, Martin <martin.muller@t-systems.com>
Co-committed-by: Muller, Martin <martin.muller@t-systems.com>
2023-06-01 08:20:00 +00:00
59917cac1f Added search index params on confpy
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-05-30 08:58:43 +00:00
b8f397e3e1 fix services to internal
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-26 07:21:04 +00:00
45f4f26ac8 deactivate VPN due to issues while Rendering
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-25 12:22:04 +00:00
4fa75d7af6 Added force push option
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-05-25 12:10:54 +00:00
d4d35ff02c Adding new documentation type for GaussDB nosql
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Boka, Ladislav <ladislav.boka@t-systems.com>
Co-committed-by: Boka, Ladislav <ladislav.boka@t-systems.com>
2023-05-25 11:59:12 +00:00
c6f3bc7e0c Fixing SFS service name
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-05-23 13:20:35 +00:00
8b1dd0814c revert 4245d4cb97
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-22 08:33:11 +00:00
4245d4cb97 refactor public images documentation
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-22 08:18:43 +00:00
47ced42e39 set status dashboard service to hidden
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-16 09:47:35 +00:00
b494b0db5a change enterprise dashboard environment to hidden
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-16 09:10:56 +00:00
40e1518c2c change service uri from UMN to SBV view
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-16 07:35:10 +00:00
e03522e98f adding fix for data-arts-studion link
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-05-12 12:47:57 +00:00
1d66be1766 add environment variable for services as preparation for SBV
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-12 07:35:08 +00:00
6ab00242d2 first update of readme
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-05-12 07:31:18 +00:00
9056f4caeb Fixing wrong dli public repo
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-05-12 07:26:51 +00:00
9cc819b011 Rolled back ecs
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-05-12 07:17:40 +00:00
648c7b72ed added new service CSE
Reviewed-by: vladimirhasko <vladimirhasko@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-05-11 17:15:54 +00:00
b4d5457009 Updated links to reflect current sbv status
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-05-05 09:08:02 +00:00
0ea50e19f3 Added service_uri for service-based-view
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-05-03 06:52:27 +00:00
58f1b9f492 Added option to specify a custom commit-description
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-05-03 06:52:24 +00:00
b711305a4c New template and options for Service-Based-View
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
2023-04-20 13:10:18 +00:00
6c27e42e4b enablign OBS permission guide on prod
Reviewed-by: vladimirhasko <vladimirhasko@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-04-19 15:30:22 +00:00
800add1b2d fixing wrong category for new services
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-04-13 07:36:08 +00:00
e7c64b24ee fixing the dataarts repo name
Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-04-12 13:49:48 +00:00
88fd397d6a adding DataArts Studio and API Gateway document metadata
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-04-12 12:07:35 +00:00
82d841953a Setting the visibility on new services to be only visible on PREPROD
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-03-28 07:37:51 +00:00
30851dd5df Enterprise router addon
Reviewed-by: vladimirhasko <vladimirhasko@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-03-26 18:01:24 +00:00
4989570371 Add some basic unittests for metadata sanity
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2023-03-26 17:51:23 +00:00
a7a4f676e0 adding new dbss service metadata
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-03-26 17:31:00 +00:00
15 changed files with 725 additions and 42 deletions

View File

@ -1,6 +1,9 @@
===============================
ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git
===============================
============
otc-metadata
============
Link: ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git
Metadata about OTC for Ecosystem
@ -13,6 +16,39 @@ Note that this is a hard requirement.
* Source: https://github.com/infra/ssh://git@gitea.eco.tsi-dev.otc-service.com:2222/infra/otc-metadata.git
Features
--------
========
* TODO
Overview: service.yaml
======================
The :code:`service.yaml` file contains all data about services, service
categories and the related documents of each service. The file is
used as a base for several internal and external applications or
websites like the Helpcenter 3.0 where the information about the document
repositories and its properties are stored.
File structure
--------------
The file is based on the yaml-file format and has three main sections
which can be compared with database tables in a relational database.
* documents: contains the information about every single document and its type
like umn, api-ref etc.
* service category: contains the keyword and title of the service category
* services: contains the repository information about the internal (Gitea) and
external location (GitHub) and all the necessary parameters of the service itself
These sections, or better "tables" have
their own keys and foreign keys so that the tables are linked together and
the related information can be fetched.
For the :code:`services` table
the key is :code:`service_type` which has the foreign key in the
:code:`documents` table. So a service can have multiple documents and each
document can only be linked to one service.
The key :code:`service_category` table is :code:`name` of the service category
which is then used in the :code:`services` table as foreign key.

File diff suppressed because it is too large Load Diff

View File

@ -113,6 +113,55 @@ class Services(object):
res[cat]["docs"].append(res_doc)
return res
def service_types_with_doc_types(self, environment=None):
"""Retrieve type and title from services and corresponding docs.
As well as a list of all available doc types with title.
:param str environment: Optional service environment.
"""
service_list = []
docs = []
for service in self.all_services:
if not service["service_title"]:
continue
if not service["service_type"]:
continue
doc_list = []
for doc in self.all_docs:
if "environment" in doc:
if doc["environment"] != environment:
continue
if doc["service_type"] == service["service_type"]:
doc_list.append({
"title": doc["title"],
"type": doc["type"]
})
new_doc = {
"type": doc["type"],
"title": doc["title"]
}
type_exists = any(
doc_dict["type"] == new_doc["type"] for doc_dict in docs
)
if not type_exists:
docs.append(new_doc)
service_list.append({
"service_title": service["service_title"],
"service_type": service["service_type"],
"docs": doc_list
})
res = {
"services": service_list,
"docs": docs
}
return res
def docs_by_service_category(self, category, environment=None):
"""List services matching category

View File

@ -18,7 +18,10 @@ import os
import sys
extensions = [
'otcdocstheme'
'otcdocstheme',
{%- if otc_sbv %}
'otc_sphinx_directives'
{%- endif %}
]
otcdocs_auto_name = False
@ -34,6 +37,16 @@ otcdocs_git_fqdn = '{{ git_fqdn }}'
otcdocs_git_type = '{{ git_type }}'
{%- endif %}
# Those variables are needed for indexing into OpenSearch
otcdocs_doc_environment = '{{ doc_environment }}'
otcdocs_doc_link = '{{ doc_link }}'
otcdocs_doc_title = '{{ doc_title }}'
otcdocs_doc_type = '{{ doc_type }}'
otcdocs_service_category = '{{ service_category }}'
otcdocs_service_title = '{{ service_title }}'
otcdocs_service_type = '{{ service_type }}'
otcdocs_search_environment = 'hc_de'
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

View File

@ -2,3 +2,6 @@ sphinx>=2.0.0,!=2.1.0 # BSD
otcdocstheme # Apache-2.0
# releasenotes
reno>=3.1.0 # Apache-2.0
otc-sphinx-directives>=0.1.0
git+https://gitea.eco.tsi-dev.otc-service.com/infra/otc-metadata.git#egg=otc_metadata

View File

@ -0,0 +1,7 @@
{{ sbv_title }}
.. directive_wrapper::
:class: container-sbv
.. service_card::
:service_type: {{ service_type }}

View File

@ -29,13 +29,17 @@ allowlist_externals =
mkdir
cp
sh
rm
sphinx-build
commands =
rm -rf doc/build/html doc/build/doctrees
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
{%- for doc in docs %}
{[testenv:{{ doc.type }}]commands}
{[testenv:json-{{ doc.type }}]commands}
{%- endfor %}
[testenv:pdf-docs]
[testenv:docs-pdf]
deps = -r{toxinidir}/doc/requirements.txt
allowlist_externals =
rm
@ -115,3 +119,7 @@ commands =
cp {{ loc }}/build/pdf/{{ doc.pdf_name }}.pdf doc/build/pdf/
{% endif %}
{% endfor %}
[doc8]
ignore = D001
extensions = .rst, .yaml

View File

@ -21,8 +21,45 @@ Tests for `otc-metadata` module.
from unittest import TestCase
from otc_metadata import services
class TestOtcMetadata(TestCase):
def setUp(self):
self.data = services.Services()
def test_something(self):
pass
def test_data_is_sorted(self):
curr = self.data
new = services.Services()
new._sort_data()
self.assertEqual(
curr._service_data, new._service_data, "Data is sorted properly"
)
def test_service_categories(self):
category = dict()
for cat in self.data._service_data["service_categories"]:
category[cat["name"]] = cat["title"]
for srv in self.data.all_services:
self.assertTrue(
srv["service_category"] in category,
f"Category {srv['service_category']} is present",
)
def test_doc_contains_required_data(self):
srv_types = dict()
for srv in self.data.all_services:
srv_types[srv["service_type"]] = srv
for doc in self.data.all_docs:
for attr in [
"rst_location",
"service_type",
"title",
"type",
]:
self.assertIn(attr, doc, f"Document {doc} contains {attr}")
self.assertIn(
doc["service_type"],
srv_types,
f"Document {doc} contains valid service_type",
)

View File

@ -4,3 +4,4 @@ requests
jinja2
dirsync
cookiecutter
opensearch-py

File diff suppressed because it is too large Load Diff

View File

@ -32,9 +32,11 @@ def process_services(args, services):
block_on_rejected_reviews=True,
dismiss_stale_approvals=True,
enable_push=False,
enable_status_check=True,
status_check_contexts=["gl/check"],
enable_merge_whitelist=True,
merge_whitelist_usernames=["zuul"],
required_approvals=1,
)
gitea_repo_template = dict(
default_branch="main",

151
tools/index_metadata.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -130,7 +130,6 @@ def process_repositories(args, service):
zuul_templates = None
zuul_jobs = dict()
zuul_new_jobs = list()
zuul_vars = dict()
zuul_config_updated = False
for item in zuul_config:
if "project" in item.keys():
@ -138,11 +137,10 @@ def process_repositories(args, service):
zuul_templates = project.setdefault("templates", [])
if not zuul_templates:
zuul_templates = []
zuul_vars = project.setdefault("vars", {})
elif "job" in item.keys():
job = item["job"]
zuul_jobs[job["name"]] = job
logging.debug(f"Existing jobs {zuul_jobs}")
print(f"Existing jobs {zuul_jobs}")
if "helpcenter-base-jobs" not in zuul_templates:
zuul_templates.append("helpcenter-base-jobs")
zuul_config_updated = True
@ -150,7 +148,6 @@ def process_repositories(args, service):
job_suffix = (
"-hc-int-jobs" if args.environment == "internal" else "-hc-jobs"
)
sphinx_pdf_files = zuul_vars.setdefault('sphinx_pdf_files', [])
for doc in data.docs_by_service_type(service["service_type"]):
logging.debug(f"Analyzing document {doc}")
if not doc.get("type"):
@ -159,12 +156,6 @@ def process_repositories(args, service):
doc_type = "dev-guide"
else:
doc_type = doc["type"]
# Collect all PDF files into sphinx_pdf_files var
pdf_name = doc.get('pdf_name')
if pdf_name and f"{pdf_name}.pdf" not in sphinx_pdf_files:
sphinx_pdf_files.append(f"{pdf_name}.pdf")
zuul_config_updated = True
template_name = f"{doc_type}{job_suffix}"
if doc_type in ["api-ref", "umn", "dev-guide"]:
if template_name not in zuul_templates:
@ -199,7 +190,6 @@ def process_repositories(args, service):
if "project" in item.keys():
project = item["project"]
project["templates"] = zuul_templates
project["vars"] = zuul_vars
# Ensure new jobs are in check
if len(zuul_new_jobs) > 0:
project.setdefault(

View File

@ -19,7 +19,6 @@ commands = {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125,W503
builtins = _

View File

@ -1,3 +1,4 @@
---
- project:
merge-mode: squash-merge
default-branch: main
@ -8,4 +9,4 @@
gate:
jobs:
- otc-tox-pep8
- otc-tox-py39
- otc-tox-py39