99designs / 99designs/cmdstalk

Proposal: Opt-in for additional meaningful exit-codes

Ouverte
#5 8 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
76
Forks
14
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

In handover we have some tasks that have various failure scenarios; sometimes it would be most appropriate to bury a task, other times it could be re-queued, maybe with a delay.

Currently cmdstalk is quite opinionated as to how to handle job failures, this one size fits all policy makes for a fine default, but it would be nice if cmdstalk supported some opt-in behaviour to allow the job command a little more control of the release strategy.

Exit codes are already meaningful, in that a non-zero code will cause cmdstalk to act based on it's opinion to either bury or release the task with a delay. With that in mind I propose allow that default behaviour to be extended, via additional args to cmdstalk, along the lines of:

`cmdstalk -on-exit=255:BURY -on-exit=254:BACKOFF -on-exit=253:RELEASE ...`

This would override the default cmdstalk exit code handling, which is still a valid use-case for when it is not possible to control the exit codes of the job command, with a more targeted approach that allows the job command input into what happens next.

Possible release / verbs would look something like (_BURY_, _DELETE_, _RELEASE_, _BACKOFF_) with backoff representing an (exponential) backoff strategy similar to cmdstalk's current default mode of operation.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Look at the cmdstalk source code to understand how exit codes are currently handled and where the job release strategy is implemented. The main entry point is likely in the command parsing and job execution logic. Examine the existing behavior for non-zero exit codes and identify where to add the new flag parsing and custom exit code mapping. Testing will involve running cmdstalk with the proposed flags and verifying the job release actions (BURY, DELETE, RELEASE, BACKOFF) work as expected.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
go, shell
Domaine
backend, cli
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
40/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.