project Utilities / Gitlab Recurring Issue avatar

utilities/gitlab_recurring_issue#9: Config Validation Mode



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.1
Created: 08-Sep-24 16:05



Description

Currently, it'd be quite easy to break things without realising.

If a bad enough config change is made, it'll prevent the YAML config from being loaded, preventing tickets from being created. Unless kube jobs are being monitored (and they should be, really) it may go unnoticed for quite some time.

It'd be good to provide some kind of validation mode which can be invoked to check that a config change is OK.



Toggle State Changes

Activity


assigned to @btasker

verified

mentioned in commit 91e5f5fc6d093ce0b7c00e1c8394a65f9312deb4

Commit: 91e5f5fc6d093ce0b7c00e1c8394a65f9312deb4 
Author: B Tasker                            
                            
Date: 2024-09-10T19:14:24.000+01:00 

Message

feat: implement dry-run mode utilities/gitlab_recurring_issue#9

+30 -7 (37 lines changed)

Decided to go all out and create a dry-run mode.

When the environment variable DRY_RUN is set to true the system won't create tickets, it'll just print details of the ticket it would have created:

Dry Run Mode
==============

Calculated Dates: {'datestr': '2024-09-10', 'Y': '2024', 'M': '09', 'DoW': 'tue', 'DoWd': 1, 'DoM': '10', 'dayw_list': ['tue', 1], 'month_list': ['9', 'sep', '*']}

----
project: misc/test_proj
title: Test Issue
labels: ['RecurringIssue', 'task', 'foobar']
description: This is a test issue 

However, this does mean that dry run will only be useful for checking stuff that would have been scheduled for today.

We should also add a flag that can be used to force time constraints to pass.

That way, it'd be possible to do something like

-e DRY_RUN=true \
-e FORCE=true

to validate the output of everything.

verified

mentioned in commit e94896045d72f6648e90736dfdb78af62745dcee

Commit: e94896045d72f6648e90736dfdb78af62745dcee 
Author: B Tasker                            
                            
Date: 2024-09-10T19:19:11.000+01:00 

Message

fix: add force-run mode (utilities/gitlab_recurring_issue#9)

This allows schedules to be ignored. It can be used with or without DRY_RUN mode

+5 -1 (6 lines changed)