Skip to content

Commit

Permalink
Merge branch 'master' into heston/DOCS-8410-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hestonhoffman authored Aug 21, 2024
2 parents 59d6f5a + c696e89 commit 55b1d59
Show file tree
Hide file tree
Showing 1,466 changed files with 132,377 additions and 24,486 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-23 18:15:38.516220",
"spec_repo_commit": "9e027051"
"regenerated": "2024-08-21 15:18:19.675370",
"spec_repo_commit": "4470dfc1"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-23 18:15:46.437930",
"spec_repo_commit": "9e027051"
"regenerated": "2024-08-21 15:18:27.960966",
"spec_repo_commit": "4470dfc1"
}
}
}
86 changes: 63 additions & 23 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,19 +1,70 @@
* @DataDog/documentation

/assets/ @DataDog/corpweb @DataDog/documentation
/data/ @DataDog/corpweb @DataDog/documentation
/data/api/ @DataDog/documentation
/local/ @DataDog/corpweb @DataDog/documentation
/layouts/ @DataDog/corpweb @DataDog/documentation
/src/ @DataDog/corpweb @DataDog/documentation
/config/ @DataDog/corpweb @DataDog/documentation
/config/_default/menus/ @DataDog/documentation
package.json @DataDog/corpweb @DataDog/documentation
go.mod @DataDog/corpweb @DataDog/documentation
go.sum @DataDog/corpweb @DataDog/documentation
# Corpweb
assets/ @DataDog/corpweb
data/ @DataDog/corpweb
layouts/ @DataDog/corpweb
config/ @DataDog/corpweb
package.json @DataDog/corpweb
go.mod @DataDog/corpweb
go.sum @DataDog/corpweb
i18n/ @DataDog/corpweb
archetypes/ @DataDog/corpweb

# Websites Platform
babel.config.js @DataDog/WebOps-Platform
data/reference/ @DataDog/WebOps-Platform
datadog-ci.preview.json @DataDog/WebOps-Platform
docker-compose-docs.yml @DataDog/WebOps-Platform
.general.preview.synthetics.json @DataDog/WebOps-Platform
.gitattributes @DataDog/WebOps-Platform
.gitignore @DataDog/WebOps-Platform
.github/ @DataDog/WebOps-Platform
.gitlab-ci.yml @DataDog/WebOps-Platform
.htmltest.yml @DataDog/WebOps-Platform
jest.config.js @DataDog/WebOps-Platform
.local/ @DataDog/WebOps-Platform
Makefile @DataDog/WebOps-Platform
Makefile.config.example @DataDog/WebOps-Platform
.nvmrc @DataDog/WebOps-Platform
postcss.config.js @DataDog/WebOps-Platform
.prettierignore @DataDog/WebOps-Platform
prettier.config.js @DataDog/WebOps-Platform
static-analysis.datadog.yml @DataDog/WebOps-Platform
.translate @DataDog/WebOps-Platform
translate.yaml @DataDog/WebOps-Platform
yarn.lock @DataDog/WebOps-Platform
.yarnrc.yml @DataDog/WebOps-Platform

# Scoped Docs/WebOps
.github/ @DataDog/WebOps-Platform
/data/api/ @DataDog/documentation
/config/_default/menus/ @DataDog/documentation
.github/ISSUE_TEMPLATE @DataDog/documentation
.github/PULL_REQUEST_TEMPLATE.md @DataDog/documentation
README.md @DataDog/documentation
local/bin/py/vale @DataDog/documentation
.github/CODEOWNERS @DataDog/WebOps-Platform @DataDog/documentation
.github/workflows/check_cache_value.yml @DataDog/documentation
.github/workflows/code-freeze.yml @DataDog/documentation
.github/workflows/gif_check.yml @DataDog/documentation
.github/workflows/preview_link.yml @DataDog/documentation
.github/workflows/vale_linter.yml @DataDog/documentation
local/bin/py/check_cache_values.py @DataDog/documentation
local/bin/py/integration-finder.py @DataDog/documentation
local/bin/py/missing_metrics.py @DataDog/documentation
local/bin/py/preview_links.py @DataDog/documentation
local/bin/py/preview-links-template.mako @DataDog/documentation
local/bin/py/build/configurations/pull_config_preview.yaml @DataDog/WebOps-Platform @DataDog/documentation
local/bin/py/build/configurations/pull_config.yaml @DataDog/WebOps-Platform @DataDog/documentation
local/**/* @DataDog/WebOps-Platform
data/sdk_versions.json @Datadog/documentation

# markdown shortcodes
layouts/shortcodes/**/*.md @DataDog/documentation

# SDK versions
.github/workflows/bump_versions.yml @DataDog/api-clients @DataDog/documentation
.github/workflows/bump_versions.yml @DataDog/api-clients @DataDog/documentation @DataDog/WebOps-Platform
/data/sdk_versions.json @DataDog/api-clients @DataDog/documentation

# Serverless
Expand Down Expand Up @@ -47,17 +98,6 @@ layouts/shortcodes/integration-assets.md @Dat
layouts/shortcodes/integration-assets-reference.md @Datadog/marketplace-product-management @DataDog/documentation
layouts/shortcodes/integration_categories.md @Datadog/marketplace-product-management @DataDog/documentation

# Websites Platform (Devops)
.github/workflows @DataDog/WebOps-Platform
.gitlab-ci.yml @DataDog/WebOps-Platform
Makefile @DataDog/WebOps-Platform
translate.yaml @DataDog/WebOps-Platform
.translate @DataDog/WebOps-Platform
docker-compose-docs.yml @DataDog/WebOps-Platform
.htmltest.yml @DataDog/WebOps-Platform
datadog-ci.preview.json @DataDog/WebOps-Platform
general.preview.synthetics.json @DataDog/WebOps-Platform

# Cloud Cost Management
documentation/content/en/cloud_cost_management/*.md @DataDog/cloud-cost-management-visibility @DataDog/documentation

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bump_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
'datadog-api-client-python',
'datadog-api-client-ruby',
'datadog-api-client-typescript',
'datadog-api-client-rust',
'integrations-core'
]
const versions = await Promise.all(clients.map(async (repo) => {
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ content/en/api/**/*.java
content/en/api/**/*.pybeta
content/en/api/**/*.rbbeta
content/en/api/**/*.ts
content/en/api/**/*.rs
content/en/api/tsconfig.json

# Ignoring all automated content
Expand Down Expand Up @@ -236,6 +237,7 @@ static/images/integrations_logos/2020w2.pdf
# Generated resources from Hugo Pipes
resources/_gen/
static/jsconfig.json
assets/jsconfig.json

# Generated from GitHub actions
.github/preview-links-template.md
Expand Down
4 changes: 3 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ before_script:
when: on_success
# ================== templates ================== #
.base_template: &base_template
image: registry.ddbuild.io/ci/websites/webops-site-build:latest
image: registry.ddbuild.io/ci/websites/webops-site-build:v42145832-00d7fc2f
tags:
- "arch:amd64"
rules:
Expand Down Expand Up @@ -156,6 +156,7 @@ build_preview:
- make config
- ./node_modules/.bin/jest --testPathPattern=assets/scripts/tests/
- yarn run prebuild
- make update_websites_sources_module
- build_site
# remove service_checks json as we don't need to s3 push that..
- rm -rf data/service_checks
Expand Down Expand Up @@ -341,6 +342,7 @@ build_live:
- make dependencies
- make vector_data
- yarn run prebuild
- make update_websites_sources_module
- build_site
- in-isolation deploy_site
- in-isolation create_artifact
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include $(CONFIG_FILE)
# API Code Examples
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
EXAMPLES_DIR = $(shell pwd)/examples/content/en/api
EXAMPLES_REPOS := datadog-api-client-go datadog-api-client-java datadog-api-client-python datadog-api-client-ruby datadog-api-client-typescript
EXAMPLES_REPOS := datadog-api-client-go datadog-api-client-java datadog-api-client-python datadog-api-client-ruby datadog-api-client-typescript datadog-api-client-rust

# Set defaults when no makefile.config or missing entries
# Use DATADOG_API_KEY if set, otherwise try DD_API_KEY and lastly fall back to false
Expand Down Expand Up @@ -68,6 +68,7 @@ server:

# Download all dependencies and run the site
start: dependencies ## Build and run docs including external content.
@make update_websites_sources_module
@make server

# Skip downloading any dependencies and run the site (hugo needs at the least node)
Expand Down Expand Up @@ -130,7 +131,7 @@ placeholders: hugpython update_pre_build
hugpython: local/etc/requirements3.txt
@${PY3} -m venv --clear $@ && . $@/bin/activate && $@/bin/pip install --upgrade pip wheel && $@/bin/pip install -r $<;\
if [[ "$(CI_COMMIT_REF_NAME)" != "" ]]; then \
$@/bin/pip install https://binaries.ddbuild.io/dd-source/python/assetlib-0.0.37052508-py3-none-any.whl; \
$@/bin/pip install https://binaries.ddbuild.io/dd-source/python/assetlib-0.0.41265762-py3-none-any.whl; \
fi

update_pre_build: hugpython
Expand All @@ -143,6 +144,12 @@ config:
envsubst '$$CI_COMMIT_REF_NAME' < "config/$(CI_ENVIRONMENT_NAME)/params.yaml" | sponge "config/$(CI_ENVIRONMENT_NAME)/params.yaml"; \
echo -e "\nbranch: ${CI_COMMIT_REF_NAME}" >> config/$(CI_ENVIRONMENT_NAME)/params.yaml;

# Automatically download the latest module from websites-sources repo
update_websites_sources_module:
node_modules/hugo-bin/vendor/hugo mod get github.com/DataDog/websites-sources@main
node_modules/hugo-bin/vendor/hugo mod clean
node_modules/hugo-bin/vendor/hugo mod tidy
cat go.mod
#######################################################################################################################
# API Code Examples
#######################################################################################################################
Expand Down Expand Up @@ -181,6 +188,7 @@ examples/$(patsubst datadog-api-client-%,clean-%-examples,$(1)):
examples/$(patsubst datadog-api-client-%,%,$(1)): examples/$(1) examples/$(patsubst datadog-api-client-%,clean-%-examples,$(1))
-find examples/$(1)/examples -iname \*.py -exec mv {} {}beta \;
-find examples/$(1)/examples -iname \*.rb -exec mv {} {}beta \;
-find examples/$(1)/examples -maxdepth 1 -iname \*.rs -exec sh -c 'mkdir -p `echo {} | sed "s/\_/\//2" | sed "s/\_/\//1" | xargs dirname` && mv {} `echo {} | sed "s/\_/\//2" | sed "s/\_/\//1"`' \;
-cp -Rn examples/$(1)/examples/v* ./content/en/api
endef

Expand All @@ -201,7 +209,6 @@ all-examples: $(foreach repo,$(EXAMPLES_REPOS),$(addprefix examples/, $(patsubst
clean-examples: $(foreach repo,$(EXAMPLES_REPOS),$(addprefix examples/, $(patsubst datadog-api-client-%,clean-%-examples,$(repo))))
@rm -rf examples


# Function that will clone a repo or sparse clone a repo
# If the dir already exists it will attempt to update it instead
#
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ For more information on contributing, see the [contribution guidelines][18].
### Datadog Staff

- Always branch off of master; never commit directly to master.
- Name your branch `<SLACK_HANDLE>/<FEATURE_NAME>`. If you don’t use this convention, the Gitlab pipeline wont run and you wont get a branch preview. Getting a branch preview makes it easier for us to check for any issues with your PR, such as broken links.
- Name your branch `slack_username/branch_name`. If you don't include the forward slash (`/`), the Gitlab pipeline won't run and you won't get a branch preview. Getting a branch preview makes it easier for us to check for any issues with your PR, such as broken links. Using a Slack username ensures you get build notifications in Slack.
- Consult our [contributing guidelines][8].
- When you're ready to commit, create a new pull request to master from your branch.
- Use GitHub's [draft pull request][15] feature and appropriate labels such as "Do Not Merge" or "Work in Progress" until your PR is ready to be merged and live on production.
- If you've named your branch correctly, a GitHub bot posts a link to the docs preview website for your PR. After the preview build completes, you can use the link to preview your changes.
- To run the build locally, see [Docs Build][20]. This is an optional step and requires setup.
- Running the build locally is optional. If you followed the branch naming conventions above, your pull request should generate a preview. For information on local builds, see the [Build setup guide][20].

### Outside Contributors

Expand Down Expand Up @@ -66,4 +66,4 @@ Within 10 minutes of merging to master, it deploys automatically.
[17]: https://docs.datadoghq.com
[18]: /CONTRIBUTING.md
[19]: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
[20]: https://datadoghq.atlassian.net/wiki/spaces/docs4docs/pages/2231206099/Docs+Build#Local-builds
[20]: https://datadoghq.atlassian.net/wiki/spaces/docs4docs/pages/3960766866/Build+setup+guide
10 changes: 10 additions & 0 deletions assets/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": [
"*"
]
}
}
}
39 changes: 33 additions & 6 deletions assets/scripts/components/async-loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ const { gaTag } = configDocs[env];

function loadPage(newUrl) {
// scroll to top of page on new page load
window.scroll({
// but only if there is no hash in the URL
const newHash = new URL(newUrl).hash;
if (!newHash) {
window.scroll({
top: 0,
left: 0,
behavior: "instant"
});
});
}

const pathName = new URL(newUrl).pathname;
const commitRef = document.documentElement.dataset.commitRef
const commitRefLen = commitRef.length ? (commitRef.length + 1) : 0

let mainContent = document.getElementById('mainContent');

Expand Down Expand Up @@ -216,10 +224,22 @@ function loadPage(newUrl) {
}
}

const pathName = new URL(newUrl).pathname;
// Clean window pathname in order to update language dropdown items href
const nonEnPage = document.documentElement.lang !== 'en-US' // check if page is not in english

// sets query params if code tabs are present
const noCommitRefPathName = pathName.slice(commitRefLen) // adjust pathname to remove commit ref if in preview env
const noCommitRefNoLangPathName = nonEnPage ? noCommitRefPathName.slice(3) : noCommitRefPathName // adjust pathname to remove language if not in english e.g. /ja/agent -> /agent

document.querySelectorAll('.language-select-container .dropdown-menu > a.dropdown-item').forEach((ddItem) => {
// Updates langauge dropdown item hrefs on asynchronous page loads
const noFtBranchddItemPathName = ddItem.pathname.slice(commitRefLen) // adjust dd item pathname to remove commit ref if in preview env
const noFtBranchNoLangddItemPathName = ddItem.dataset.lang ? noFtBranchddItemPathName.slice(3) : noFtBranchddItemPathName // adjust dd item pathname to remove language if not in english e.g. /ja/agent -> /agent

const updatedURL = ddItem.href.replace(noFtBranchNoLangddItemPathName, noCommitRefNoLangPathName)
ddItem.setAttribute('href', updatedURL)
})

// sets query params if code tabs are present
initCodeTabs();

const regionSelector = document.querySelector('.js-region-select');
Expand All @@ -237,7 +257,7 @@ function loadPage(newUrl) {
toggleMultiCodeLangNav(pageCodeLang);
hideTOCItems(true)
initCopyCode()

// Gtag virtual pageview
gtag('config', gaTag, { page_path: pathName });

Expand All @@ -253,8 +273,15 @@ function loadPage(newUrl) {
httpRequest.open('GET', newUrl);
httpRequest.send();
} else {
window.location.href = newUrl;
// Integrations Pages

if(pathName.slice(commitRefLen) !== document.documentElement.dataset.relpermalink) {
// if switching between integrations pages, reload page. adjusts the pathName to remove commit ref if in preview env.
window.location.href = newUrl;
}
}
}

export {loadPage};


Loading

0 comments on commit 55b1d59

Please sign in to comment.