Page MenuHomeDevCentral

Add DNS SOA serial validation pre-commit hook
Needs ReviewPublic

Authored by yousra on Wed, Apr 22, 22:03.
Tags
Referenced Files
F26651310: D4092.id10706.diff
Fri, Apr 24, 13:47
F26651294: D4092.id10708.diff
Fri, Apr 24, 13:47
F26643992: D4092.id10707.diff
Fri, Apr 24, 12:19
Unknown Object (File)
Thu, Apr 23, 08:49
Unknown Object (File)
Thu, Apr 23, 03:59
Unknown Object (File)
Thu, Apr 23, 02:20

Details

Summary

This change introduces a validation script to ensure that DNS zone files have their SOA serial
incremented whenever a real DNS record modification is made.

It also validates the format of the SOA serial before checking whether it has been bumped.

The goal is to enforce correct DNS behavior by requiring a serial update only when meaningful
changes occur (e.g. IP change), while ignoring non-significant changes such as extra
spaces that will be corrected during code review.

The validation is integrated as a pre-commit hook and only applies to .zone files.

Ref T2149

Test Plan

Test 1:

  • Modify a .zone file (e.g. change an IP)
  • Do not update the SOA serial
  • Commit

→ The commit should fail with an error

Test 2:

  • Make a non-significant change (e.g. extra spaces)
  • Do not update the SOA serial
  • Commit

→ No error should occur

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Skipped
Unit
No Test Coverage
Branch
T2149-dns
Build Status
Buildable 6668
Build 6956: arc lint + arc unit

Event Timeline

yousra requested review of this revision.Wed, Apr 22, 22:03
yousra created this revision.
yousra retitled this revision from test to Add DNS SOA serial validation pre-commit hook.Wed, Apr 22, 22:06
yousra edited the summary of this revision. (Show Details)
yousra added reviewers: dereckson, Duranzed.
yousra added a project: DNS.
yousra edited the summary of this revision. (Show Details)
yousra edited the summary of this revision. (Show Details)
yousra added subscribers: dereckson, Duranzed.
yousra edited the summary of this revision. (Show Details)
yousra edited the test plan for this revision. (Show Details)

Moved DNS validation scripts to _tests/roles/python/dns/ for better organization.

Added verification of SOA serial format

Actually there are 2 formats serial accepted :

  • YYYYMMDD (8 digits)
  • YYYYMMDDNN (10 digits)