Skip to content

Commit

Permalink
Update Slugs + Add Aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
alai97 committed Dec 5, 2023
1 parent c53146a commit 6739086
Show file tree
Hide file tree
Showing 407 changed files with 24,913 additions and 22 deletions.
30 changes: 15 additions & 15 deletions config/_default/menus/menus.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2617,37 +2617,37 @@ main:
parent: cd_explorer
weight: 303
- name: DORA Metrics
url: continuous_integration/dora_metrics/
url: dora_metrics/
pre: ci
parent: software_delivery_heading
identifier: ci_explorer_dora_metrics
identifier: dora_metrics
weight: 170000
- name: Static Analysis
url: continuous_integration/static_analysis/
url: static_analysis/
pre: ci
parent: software_delivery_heading
identifier: ci_static_analysis
identifier: static_analysis
weight: 180000
- name: Rules
url: continuous_integration/static_analysis/rules
parent: ci_static_analysis
identifier: ci_static_analysis_rules
url: static_analysis/rules
parent: static_analysis
identifier: static_analysis_rules
weight: 101
- name: CircleCI Orbs
url: continuous_integration/static_analysis/circleci_orbs
parent: ci_static_analysis
identifier: ci_static_analysis_circleci_orbs
url: static_analysis/circleci_orbs
parent: static_analysis
identifier: static_analysis_circleci_orbs
weight: 102
- name: GitHub Actions
url: continuous_integration/static_analysis/github_actions
parent: ci_static_analysis
identifier: ci_static_analysis_github_actions
url: static_analysis/github_actions
parent: static_analysis
identifier: static_analysis_github_actions
weight: 103
- name: Quality Gates
url: continuous_integration/quality_gates/
url: quality_gates/
pre: ci
parent: software_delivery_heading
identifier: ci_quality_gates
identifier: quality_gates
weight: 190000
- name: Database Monitoring
url: database_monitoring/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: DORA Metrics
kind: documentation
description: Learn how to use DORA metrics to improve and measure software development.
aliases:
- /continuous_integration/dora_metrics
is_beta: true
further_reading:
- link: "/continuous_integration/tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Quality Gates
kind: documentation
description: Learn how to use Quality Gates in your pipeline.
is_beta: true
aliases:
- /continuous_integration/quality_gates
further_reading:
- link: "/continuous_integration/tests"
tag: "Documentation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Static Analysis
kind: documentation
description: Learn about Datadog Static Analysis to scan code for quality issues and security vulnerabilities before your code reaches production.
aliases:
- /continuous_integration/static_analysis/
is_beta: true
further_reading:
- link: "https://www.datadoghq.com/blog/monitor-ci-pipelines/"
Expand Down
102 changes: 102 additions & 0 deletions content/en/static_analysis/circleci_orbs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
aliases:
- /continuous_integration/static_analysis/circleci_orbs
dependencies:
- https://github.com/DataDog/datadog-static-analyzer-circleci-orb/blob/main/README.md
description: Use Datadog and CircleCI to run Static Analysis jobs in a CI pipeline.
kind: documentation
title: Static Analysis and CircleCI Orbs
---
[![CircleCI Build Status](https://circleci.com/gh/DataDog/datadog-static-analyzer-circleci-orb.svg?style=shield "CircleCI Build Status")](https://circleci.com/gh/DataDog/datadog-static-analyzer-circleci-orb) [![CircleCI Orb Version](https://badges.circleci.com/orbs/DataDog/datadog-static-analyzer-circleci-orb.svg)](https://circleci.com/developer/orbs/orb/DataDog/datadog-static-analyzer-circleci-orb) [![GitHub License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/DataDog/datadog-static-analyzer-circleci-orb/main/LICENSE) [![CircleCI Community](https://img.shields.io/badge/community-CircleCI%20Discuss-343434.svg)](https://discuss.circleci.com/c/ecosystem/orbs)


Run a Datadog Static Analysis in your CircleCI workflows.

## Requirements

To use the Datadog static analyzer, you need to add a `static-analysis.datadog.yml` file to your repositories root directory that specifies what rulesets to use.

```yaml
rulesets:
- <ruleset-name>
- <ruleset-name>
```
#### Example for Python
You can see an example for repositories based on Python:
```yaml
rulesets:
- python-security
- python-code-style
- python-best-practices
```
## Workflow
Create a file in `.circleci` to run a Datadog static analysis.

Here's a sample workflow file.

```yaml
version: 2.1
orbs:
datadog-static-analysis: datadog/datadog-static-analyzer-circleci-orb@1.0.0
jobs:
run-static-analysis-job:
docker:
- image: cimg/node:current
steps:
- checkout
- datadog-static-analysis/analyze:
service: my-service
workflows:
main:
jobs:
- run-static-analysis-job
```

## Environment Variables

These environment variables should be set in the [CircleCI Project Settings](https://circleci.com/docs/set-environment-variable/#set-an-environment-variable-in-a-project) page.

| Name | Description | Required | Default |
|--------------|----------------------------------------------------------------------------------------------------------------------------|----------|-----------------|
| `DD_API_KEY` | Your Datadog API key. This key is created by your [Datadog organization](https://docs.datadoghq.com/account_management/api-app-keys/#api-keys) and should be stored as a secret. | True | |
| `DD_APP_KEY` | Your Datadog Application key. This key is created by your [Datadog organization](https://docs.datadoghq.com/account_management/api-app-keys/) and should be stored as a secret. | True | |

## Inputs

To customize your workflow, you can set the following parameters for an analysis.

| Name | Description | Required | Default |
|--------------|----------------------------------------------------------------------------------------------------------------------------|----------|-----------------|
| `service` | The service you want your results tagged with. | True | |
| `env` | The environment you want your results tagged with. | False | `none` |
| `site` | The [Datadog site](https://docs.datadoghq.com/getting_started/site/) | False | `datadoghq.com` |

## Resources

[CircleCI Orb Registry Page](https://circleci.com/developer/orbs/orb/DataDog/datadog-static-analyzer-circleci-orb) - The official registry page of this orb for all versions, executors, commands, and jobs described.

[CircleCI Orb Docs](https://circleci.com/docs/orb-intro/#section=configuration) - Docs for using, creating, and publishing CircleCI Orbs.

### How to Contribute

We welcome [issues](https://github.com/DataDog/datadog-static-analyzer-circleci-orb/issues) to and [pull requests](https://github.com/DataDog/datadog-static-analyzer-circleci-orb/pulls) against this repository!

### How to Publish An Update
1. Merge pull requests with desired changes to the main branch.
- For the best experience, squash-and-merge and use [Conventional Commit Messages](https://conventionalcommits.org/).
2. Find the current version of the orb.
- You can run `circleci orb info DataDog/datadog-static-analyzer-circleci-orb | grep "Latest"` to see the current version.
3. Create a [new Release](https://github.com/DataDog/datadog-static-analyzer-circleci-orb/releases/new) on GitHub.
- Click "Choose a tag" and _create_ a new [semantically versioned](http://semver.org/) tag. (ex: v1.0.0)
- We will have an opportunity to change this before we publish if needed after the next step.
4. Click _"+ Auto-generate release notes"_.
- This will create a summary of all of the merged pull requests since the previous release.
- If you have used _[Conventional Commit Messages](https://conventionalcommits.org/)_ it will be easy to determine what types of changes were made, allowing you to ensure the correct version tag is being published.
5. Now ensure the version tag selected is semantically accurate based on the changes included.
6. Click _"Publish Release"_.
- This will push a new tag and trigger your publishing pipeline on CircleCI.
72 changes: 72 additions & 0 deletions content/en/static_analysis/github_actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
aliases:
- /continuous_integration/static_analysis/github_actions
dependencies:
- https://github.com/DataDog/datadog-static-analyzer-github-action/blob/main/README.md
description: Use Datadog and GitHub to run Static Analysis jobs in a CI pipeline.
kind: documentation
title: Static Analysis and GitHub Actions
---
Run a Datadog Static Analysis in your Github Action workflows.

## Requirements

To use the Datadog static analyzer, you need to add a `static-analysis.datadog.yml` file to your repositories root directory that specifies what rulesets to use.

```yaml
rulesets:
- <ruleset-name>
- <ruleset-name>
```
#### Example for Python
You can see an example for repositories based on Python:
```yaml
rulesets:
- python-security
- python-code-style
- python-best-practices
```
## Workflow
Create a file in `.github/workflows` to run a Datadog static analysis.

Here's a sample workflow file.

```yaml
on: [push]
jobs:
check-quality:
runs-on: ubuntu-latest
name: Datadog Static Analyzer
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check code meets quality standards
id: datadog-static-analysis
uses: DataDog/datadog-static-analyzer-github-action@v1.0.0
with:
dd_app_key: ${{ secrets.DD_APP_KEY }}
dd_api_key: ${{ secrets.DD_API_KEY }}
dd_service: "my-service"
dd_env: "ci"
```

> You **must** set your Datadog API and Application Keys as secrets in your GitHub repository. For more information, see [API and Application Keys][1]

## Inputs

| Name | Description | Required | Default |
|--------------|----------------------------------------------------------------------------------------------------------------------------|----------|-----------------|
| `dd_api_key` | Your Datadog API key. This key is created by your [Datadog organization][1] and should be stored as a [secret][2]. | True | |
| `dd_app_key` | Your Datadog Application key. This key is created by your [Datadog organization][1] and should be stored as a [secret][2]. | True | |
| `dd_service` | The service you want your results tagged with. | True | |
| `dd_env` | The environment you want your results tagged with. | False | `none` |
| `dd_site` | The [Datadog site](https://docs.datadoghq.com/getting_started/site/) | False | `datadoghq.com` |

[1]: https://docs.datadoghq.com/account_management/api-app-keys/
[2]: https://docs.github.com/en/actions/security-guides/encrypted-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Static Analysis Rules
kind: documentation
description: View rules for multiple languages for Static Analysis.
is_beta: true
aliases:
- /continuous_integration/static_analysis/rules
docker_best_practices_data:
- link: "/continuous_integration/static_analysis/rules/docker-best-practices/absolute-workdir"
tag: "absolute-workdir"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
dependencies: []
disable_edit: true
kind: documentation
meta:
category: Best Practices
id: docker-best-practices/absolute-workdir
language: Docker
severity: Warning
title: Use absolute workdir
---
## Metadata
**ID:** `docker-best-practices/absolute-workdir`

**Language:** Docker

**Severity:** Warning

**Category:** Best Practices

## Description
When using a relative `WORKDIR`, you may run into problems since you are dependent on previous `WORKDIR` instructions. Using an absolute `WORKDIR` ensures you have the right path no matter where the instruction is positioned.

## Non-Compliant Code Examples

Check warning on line 24 in content/en/static_analysis/rules/docker-best-practices/absolute-workdir.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/static_analysis/rules/docker-best-practices/absolute-workdir.md#L24

[Datadog.headings] 'Non-Compliant Code Examples' should use sentence-style capitalization.
Raw output
{"message": "[Datadog.headings] 'Non-Compliant Code Examples' should use sentence-style capitalization.", "location": {"path": "content/en/static_analysis/rules/docker-best-practices/absolute-workdir.md", "range": {"start": {"line": 24, "column": 4}}}, "severity": "WARNING"}
```docker
FROM busybox
WORKDIR usr/src/app
```

## Compliant Code Examples

Check warning on line 30 in content/en/static_analysis/rules/docker-best-practices/absolute-workdir.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/static_analysis/rules/docker-best-practices/absolute-workdir.md#L30

[Datadog.headings] 'Compliant Code Examples' should use sentence-style capitalization.
Raw output
{"message": "[Datadog.headings] 'Compliant Code Examples' should use sentence-style capitalization.", "location": {"path": "content/en/static_analysis/rules/docker-best-practices/absolute-workdir.md", "range": {"start": {"line": 30, "column": 4}}}, "severity": "WARNING"}
```docker
FROM busybox
WORKDIR /usr/src/app
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
dependencies: []
disable_edit: true
kind: documentation
meta:
category: Error Prone
id: docker-best-practices/alias-must-be-unique
language: Docker
severity: Warning
title: FROM aliases must be unique
---
## Metadata
**ID:** `docker-best-practices/alias-must-be-unique`

**Language:** Docker

**Severity:** Warning

**Category:** Error Prone

## Description
When using multiple images in a Dockerfile, aliases must be unique.

## Non-Compliant Code Examples

Check warning on line 24 in content/en/static_analysis/rules/docker-best-practices/alias-must-be-unique.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/static_analysis/rules/docker-best-practices/alias-must-be-unique.md#L24

[Datadog.headings] 'Non-Compliant Code Examples' should use sentence-style capitalization.
Raw output
{"message": "[Datadog.headings] 'Non-Compliant Code Examples' should use sentence-style capitalization.", "location": {"path": "content/en/static_analysis/rules/docker-best-practices/alias-must-be-unique.md", "range": {"start": {"line": 24, "column": 4}}}, "severity": "WARNING"}
```docker
FROM awesomeimage:version as build
RUN stuff
FROM otherawesomeimage:version1 as foobar
RUN plop
FROM otherawesomeimage:version2 as build
RUN more_stuff
```

## Compliant Code Examples

Check warning on line 34 in content/en/static_analysis/rules/docker-best-practices/alias-must-be-unique.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/static_analysis/rules/docker-best-practices/alias-must-be-unique.md#L34

[Datadog.headings] 'Compliant Code Examples' should use sentence-style capitalization.
Raw output
{"message": "[Datadog.headings] 'Compliant Code Examples' should use sentence-style capitalization.", "location": {"path": "content/en/static_analysis/rules/docker-best-practices/alias-must-be-unique.md", "range": {"start": {"line": 34, "column": 4}}}, "severity": "WARNING"}
```docker
FROM awesomeimage:version as build
RUN stuff
FROM otherawesomeimage:version as another-alias
RUN more_stuff
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
dependencies: []
disable_edit: true
kind: documentation
meta:
category: Best Practices
id: docker-best-practices/apt-get-yes
language: Docker
severity: Warning
title: Always use -y with apt-get install
---
## Metadata
**ID:** `docker-best-practices/apt-get-yes`

**Language:** Docker

**Severity:** Warning

**Category:** Best Practices

## Description
When using `apt-get` to install a package, make sure you use the `-y` flag to avoid your CI being blocked on a prompt.

## Non-Compliant Code Examples

Check warning on line 24 in content/en/static_analysis/rules/docker-best-practices/apt-get-yes.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/static_analysis/rules/docker-best-practices/apt-get-yes.md#L24

[Datadog.headings] 'Non-Compliant Code Examples' should use sentence-style capitalization.
Raw output
{"message": "[Datadog.headings] 'Non-Compliant Code Examples' should use sentence-style capitalization.", "location": {"path": "content/en/static_analysis/rules/docker-best-practices/apt-get-yes.md", "range": {"start": {"line": 24, "column": 4}}}, "severity": "WARNING"}
```docker
RUN apt-get install gcc
```

## Compliant Code Examples

Check warning on line 29 in content/en/static_analysis/rules/docker-best-practices/apt-get-yes.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/en/static_analysis/rules/docker-best-practices/apt-get-yes.md#L29

[Datadog.headings] 'Compliant Code Examples' should use sentence-style capitalization.
Raw output
{"message": "[Datadog.headings] 'Compliant Code Examples' should use sentence-style capitalization.", "location": {"path": "content/en/static_analysis/rules/docker-best-practices/apt-get-yes.md", "range": {"start": {"line": 29, "column": 4}}}, "severity": "WARNING"}
```docker
RUN apt-get install -y gcc
```
Loading

0 comments on commit 6739086

Please sign in to comment.