Compare commits

...

28 Commits

Author SHA1 Message Date
03ecab9755 Rename tox target for pdf build
All checks were successful
gl/check check status: success (03ecab9755562d7f4efc3c3b914b787c73a48eb8)
zuul jobs require target to be called pdf-docs instead of docs-pdf
2023-03-23 12:37:25 +01:00
ec59663c39 Include pdf filenames into zuul config
Zuul jobs expect to know PDF filenames to be fetching from artifacts.
Best way is to include them into the project config while managing zuul
config.
2023-03-23 12:37:25 +01:00
b52b0bb5e0 Change html_link for PFS and Perms Guide
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-03-13 14:42:24 +00:00
ccfbd0c235 dli_repo
Reviewed-by: Gode, Sebastian <sebastian.gode@telekom.de>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-03-10 12:43:56 +00:00
28baf2213e Update 'tools-requirements.txt'
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@telekom.de>
Co-committed-by: Gode, Sebastian <sebastian.gode@telekom.de>
2023-03-10 11:39:44 +00:00
6779395a19 pfs_folder_fix
Reviewed-by: Gode, Sebastian <sebastian.gode@telekom.de>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-03-08 11:47:21 +00:00
4e34a4fa80 adding new documentation type for OBS
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-02-22 08:56:11 +00:00
c037ca9a53 Fixed spelling of MapReduce Service
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: Gode, Sebastian <sebastian.gode@telekom.de>
Co-committed-by: Gode, Sebastian <sebastian.gode@telekom.de>
2023-02-21 10:46:34 +00:00
8de5c8ba57 add get_service_with_docs_by_service_type()
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-02-21 10:44:51 +00:00
e06e27d0e0 add PLAS title
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-02-21 08:41:44 +00:00
148e88184e change Cloud Container Service to Engine
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: tischrei <tino.schreiber@t-systems.com>
Co-committed-by: tischrei <tino.schreiber@t-systems.com>
2023-02-21 07:21:58 +00:00
dd76d849f0 disabling visibility of ddm and cci services
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-02-15 23:29:42 +00:00
8d34f223e9 adding cci 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-02-14 10:06:15 +00:00
2e4ab3ec77 adding metadata for new repository
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-02-14 00:32:53 +00:00
3fc3610cb5 added new ddm service, obs pfs document, modelarts sdk document metadata
Reviewed-by: Kvrivishvili, Iustina <iustina.kvrivishvili@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2023-02-10 10:23:12 +00:00
83b42c8053 adding swift metadata
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-02-01 07:41:04 +00:00
eb996cfbfc Replacing shutil copytree by dirsync
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-01-30 07:52:19 +00:00
ccd8ac5fcb adding link for dws tool guide
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-01-23 12:44:02 +00:00
c5b22fe720 fixing natgw old hc 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-01-23 11:40:48 +00:00
9c7a933e0c smg fix
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-01-19 18:55:13 +00:00
d04569f7ca Secure Mail Gateway addon
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-01-19 13:55:53 +00:00
aa1dccf219 include public images in ims docs
Reviewed-by: tischrei <tino.schreiber@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2023-01-19 08:52:02 +00:00
78e982b20c removing DAS service
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-01-18 17:22:20 +00:00
6c4bcbd6db removing cdn from metadata
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-01-18 16:00:18 +00:00
e380347dd0 adding mycredential document metadata
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-01-18 13:46:31 +00:00
b02b97f5c3 added new documentation entry
Reviewed-by: Kucerak, Kristian <kristian.kucerak@t-systems.com>
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-01-13 15:06:35 +00:00
07b3c97d7d Update tox template
Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2023-01-09 08:27:08 +00:00
641ec7ddd2 update gitcontrol repo template
Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2023-01-03 09:17:55 +00:00
9 changed files with 222 additions and 51 deletions

File diff suppressed because it is too large Load Diff

View File

@ -209,3 +209,22 @@ class Services(object):
doc_struct[srv["service_category"]].append(srv_res)
return dict(categories=doc_struct)
def get_service_with_docs_by_service_type(self, service_type):
"""Retrieve service and service docs by service_type
:param str service_type: Filter by service_type
"""
res = dict()
res['service'] = {}
docs = []
services = self._service_data
for doc in services['documents']:
if doc['service_type'] == service_type:
docs.append(doc)
res['documents'] = docs
for service in services['services']:
if service['service_type'] == service_type:
res['service'] = service
break
return res

View File

@ -104,6 +104,9 @@ html_title = "{{ title }}"
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Do not include sources into the rendered results
html_copy_source = False
# -- Options for PDF output --------------------------------------------------
latex_documents = [
{%- if pdf_name is defined %}

View File

@ -21,18 +21,28 @@ deps =
-r{toxinidir}/requirements.txt
commands = {posargs}
# This env is invoked in the periodic pipeline and is therefore responsible to
# build all relevant docs at once.
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
allowlist_externals =
mkdir
cp
sh
commands =
{%- for doc in docs %}
{[testenv:{{ doc.type }}]commands}
{[testenv:json-{{ doc.type }}]commands}
{%- endfor %}
[testenv:docs-pdf]
[testenv:pdf-docs]
deps = -r{toxinidir}/doc/requirements.txt
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
mkdir -p doc/build/pdf
{%- for doc in docs %}
@ -68,11 +78,12 @@ deps = -r{toxinidir}/doc/requirements.txt
allowlist_externals =
cp
mkdir
find
sh
commands =
sphinx-build -W --keep-going -b json {{ loc }}/source doc/build/json/{{ doc.type }}
# Drop data useless for the search
find doc/build/json -type d -and ( -name '_images' -or -name '_static' -or -name '_sources' ) -exec rm {:} ;
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
{%- if doc.type == 'api-ref' %}
mkdir -p api-ref/build/json
cp -av doc/build/json/api-ref api-ref/build/json

View File

@ -1,2 +1,6 @@
GitPython
ruamel
ruamel.yaml
requests
jinja2
dirsync
cookiecutter

View File

@ -201,7 +201,7 @@ def process_repositories(args, service):
repo_to.git.push(*push_args)
if "github" in url_to:
subprocess.run(
args=["gh", "pr", "create", "-f"], cwd=copy_to, check=True
args=["gh", "pr", "create", "-f"], cwd=copy_to, check=False
)
elif "gitea" in url_to and args.token:
open_pr(

View File

@ -46,7 +46,7 @@ def process_services(args, services):
has_wiki=False,
default_delete_branch_after_merge=True,
allow_merge_commit=False,
allow_squash_merge=False,
allow_squash_merge=True,
allow_rebase_merge=False,
default_merge_style="squash",
branch_protections=[],

View File

@ -18,9 +18,9 @@ import argparse
import logging
import os
import pathlib
import shutil
import subprocess
import warnings
from dirsync import sync
from git import Repo
from git import SymbolicReference
@ -111,13 +111,21 @@ def process_repositories(args, service):
new_branch.set_tracking_branch(remote_ref)
new_branch.checkout()
shutil.copytree(
pathlib.Path(copy_from, doc["rst_location"]),
pathlib.Path(copy_to, doc["rst_location"]),
ignore=lambda a, b: ["conf.py"],
dirs_exist_ok=True,
source_path = pathlib.Path(copy_from, doc["rst_location"])
target_path = pathlib.Path(copy_to, doc["rst_location"])
sync(
source_path,
target_path,
'sync',
purge=True,
create=True,
content=True,
ignore=['conf.py']
)
repo_to.index.add([doc["rst_location"]])
for obj in repo_to.index.diff(None).iter_change_type('D'):
repo_to.index.remove([obj.b_path])
if len(repo_to.index.diff("HEAD")) == 0:
# Nothing to commit
logging.debug("No changes.")

View File

@ -130,6 +130,7 @@ 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():
@ -137,10 +138,11 @@ 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
print(f"Existing jobs {zuul_jobs}")
logging.debug(f"Existing jobs {zuul_jobs}")
if "helpcenter-base-jobs" not in zuul_templates:
zuul_templates.append("helpcenter-base-jobs")
zuul_config_updated = True
@ -148,6 +150,7 @@ 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"):
@ -156,6 +159,12 @@ 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:
@ -190,6 +199,7 @@ 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(