Skip to content

Commit

Permalink
Start validating version in CI (DataDog#18077)
Browse files Browse the repository at this point in the history
* Start validating version in CI

* Fix changelogs and ignore ddev
  • Loading branch information
iliakur authored Jul 20, 2024
1 parent 1f0af38 commit 70537a4
Show file tree
Hide file tree
Showing 50 changed files with 267 additions and 61 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ on:
required: false
default: false
type: boolean
version:
required: false
default: false
type: boolean

defaults:
run:
Expand Down Expand Up @@ -231,6 +235,10 @@ jobs:
if: inputs.labeler
run: ddev validate labeler

- name: Validate target version
if: inputs.version
run: ddev validate version $TARGET

# Every validation below here is sorted by increasing runtime rather than alphabetically
- name: Validate third-party license metadata
if: inputs.licenses
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ jobs:
readmes: true
saved-views: true
service-checks: true
version: true
secrets: inherit
7 changes: 6 additions & 1 deletion agent_metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Agent Metrics

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion amazon_eks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Amazon EKS

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion amazon_eks_blueprints/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - amazon_eks_blueprints

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion azure_active_directory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Azure Active Directory

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
4 changes: 1 addition & 3 deletions cisco_duo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# CHANGELOG - cisco_duo

<!-- towncrier release notes start -->

## 1.0.0 / 2024-01-31

***Added***:

* Initial Release
* Initial Release
6 changes: 5 additions & 1 deletion cisco_sdwan/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# CHANGELOG - Cisco SD-WAN

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
4 changes: 1 addition & 3 deletions cisco_umbrella_dns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# CHANGELOG - cisco_umbrella_dns

<!-- towncrier release notes start -->

1.0.0 / 2024-01-01
## 1.0.0 / 2024-01-01

***Added***:

Expand Down
7 changes: 6 additions & 1 deletion consul_connect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Consul Connect

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion container/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Container

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion containerd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Containerd

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion cri/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - CRI

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion databricks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Databricks

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
2 changes: 0 additions & 2 deletions datadog_operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# CHANGELOG - Datadog Operator

<!-- towncrier release notes start -->

## 1.0.0 / 2023-03-30

***Added***:
Expand Down
17 changes: 11 additions & 6 deletions ddev/src/ddev/cli/validate/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,14 @@ def version(ctx: click.Context, integrations: tuple[str, ...]):
if not integrations:
integrations = ('all',)

for current_check in app.repo.integrations.iter_all(selection=integrations):
changelog = current_check.path / 'CHANGELOG.md'
version_file = current_check.package_directory / '__about__.py'
for project in app.repo.integrations.iter_all(selection=integrations):
# ddev manages its version dynamically.
if project.name == 'ddev':
continue
changelog = project.path / 'CHANGELOG.md'
version_file = project.package_directory / ('_version.py' if project.name == 'ddev' else '__about__.py')
is_python_pkg = version_file.exists()
track_err = partial(tracker.error, (current_check.name,))
track_err = partial(tracker.error, (project.name,))

if is_python_pkg and not changelog.exists():
track_err(message=f'This looks like a Python package, but {changelog.relative_to(repo_path)} is missing.')
Expand All @@ -126,12 +129,14 @@ def version(ctx: click.Context, integrations: tuple[str, ...]):

if is_python_pkg:
validate = _validate_python_package
else:
elif project.is_tile:
validate = _validate_tile_only_int
else:
continue
validate(
track_err,
repo_path,
current_check,
project,
version_file,
changelog,
changelog_is_autogenerated,
Expand Down
2 changes: 0 additions & 2 deletions docker_daemon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# CHANGELOG - docker_daemon

<!-- towncrier release notes start -->

## 1.12.0 / 2020-01-13

***Added***:
Expand Down
7 changes: 6 additions & 1 deletion eks_anywhere/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Amazon EKS Anywhere

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion gke/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Google Kubernetes Engine

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
2 changes: 0 additions & 2 deletions go-metro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# CHANGELOG - go-metro

<!-- towncrier release notes start -->

## 1.3.1 / 2021-03-07

***Fixed***:
Expand Down
7 changes: 6 additions & 1 deletion helm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Helm

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion iam_access_analyzer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Iam Access Analyzer

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion jmeter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - JMeter

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
2 changes: 0 additions & 2 deletions kubernetes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# CHANGELOG - kubernetes

<!-- towncrier release notes start -->

## 1.7.0 / 2020-05-17

***Added***:
Expand Down
7 changes: 6 additions & 1 deletion kubernetes_state_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Kubernetes State Core

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion ntp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - NTP

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion nvidia_jetson/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Nvidia Jetson

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion oke/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Oracle Container Engine for Kubernetes - OKE

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion oom_kill/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - OOM Kill

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion openai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - OpenAI

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion openshift/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - OpenShift

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion otel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - OTel

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion pivotal_pks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Pivotal PKS

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
7 changes: 6 additions & 1 deletion podman/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# CHANGELOG - Podman

<!-- towncrier release notes start -->

## 1.0.0

***Added***:

* Initial release.
Loading

0 comments on commit 70537a4

Please sign in to comment.