adnv 1.5.1

CLI that tracks, checks and auto-updates infrastructure dependency versions across Terraform, Helm, Docker, Git and npm
Documentation
# Tracking Outdated Dependencies

This tutorial walks you through setting up adnv to continuously track outdated dependencies in a Terraform + Helm project, with notifications to your team.

## Scenario

You maintain a Terraform project with:
- Terraform modules from GitLab
- Terraform providers from the HashiCorp registry
- Helm chart dependencies in `Chart.yaml`

You want to scan weekly and notify your team on Mattermost.

## Step 1: Scan your project

First, check what adnv finds:

```shell
adnv outdated --recursive
```

Example output:

```
Terraform modules
┌──────────────────────────────┬─────────┬────────┬────────┬─────────────────┐
│ Source                       │ Current │ Wanted │ Latest │ Location        │
├──────────────────────────────┼─────────┼────────┼────────┼─────────────────┤
│ gitlab.com/org/vpc           │ 2.1.0   │ 2.3.1  │ 2.3.1  │ network.tf:3:5  │
│ gitlab.com/org/k8s-cluster   │ 1.0.0   │ 1.0.0  │ 2.0.0  │ k8s.tf:12:5     │
└──────────────────────────────┴─────────┴────────┴────────┴─────────────────┘

Helm chart dependencies
┌────────────────────────┬─────────┬────────┬────────┬──────────────────┐
│ Source                 │ Current │ Wanted │ Latest │ Location         │
├────────────────────────┼─────────┼────────┼────────┼──────────────────┤
│ nginx-ingress          │ 0.16.0  │ 0.17.2 │ 0.17.2 │ Chart.yaml:8:5   │
└────────────────────────┴─────────┴────────┴────────┴──────────────────┘
```

Notice the "Wanted" vs "Latest" distinction:
- **Wanted**: Best version matching your constraint (e.g., `~> 2.0`)
- **Latest**: Absolute latest version available

## Step 2: Track inner dependencies with inline hints

For dependencies embedded within Terraform attributes (not in `source`/`version` fields), use inline hints:

```hcl
module "ingress" {
  source  = "gitlab.com/org/k8s-tools/ingress"
  version = "1.0.0"

  # @adnv source "helm+https://helm.nginx.com/stable#name=nginx-ingress" ">= 0.10.0, < 1.0.0"
  chart_version = "0.16.0"
}
```

The `# @adnv source` comment tells adnv to track the Helm chart version on the next line, constrained to `>= 0.10.0, < 1.0.0`.

## Step 3: Set up monitoring with check

Create `adnv.yml`:

```yaml
version: 1
check:
  sources:
    - label: VPC Module
      source: git+https://gitlab.com/org/vpc
    - label: K8s Cluster
      source: git+https://gitlab.com/org/k8s-cluster
    - label: Nginx Ingress Chart
      source: helm+https://helm.nginx.com/stable#name=nginx-ingress
  outputs:
    mattermost: !Mattermost
      instance_url: https://mattermost.example.com
      api_key: $MATTERMOST_API_KEY
      channel_id: your-channel-id
      message_template: |
        **Dependency Update Report**

        {{ count }} new versions in the last {{ duration }}

        {{ versions_table }}
```

Run it:

```shell
adnv check --last 7days --output mattermost
```

## Step 4: Automate in CI

Add to your `.gitlab-ci.yml`:

```yaml
dependency-check:
  image: registry.gitlab.com/adnap/tools/adnv:latest
  schedule:
    cron: "0 9 * * 1"  # Every Monday at 9am
  script:
    - adnv check --last 7days --output mattermost
```

## What's next?

- [Auto-Update Dependencies]../how-to/auto-update.md - Let adnv update files for you
- [Configure Notifications]../how-to/notifications.md - Set up email, Matrix, or Mattermost
- [Supported Sources]../reference/sources.md - All registry types