'Code comment with scheduled Git changeset

I'm wondering if something like the code sample below is possible:

val = calculate_method1()

# GIT-COMMAND-DELETE date="2022-05-23" msg="About time to delete it"
val = temporary_overriden__calculate_method1()
# GIT-COMMAND-DELETE

# GIT-COMMAND-ADD date="2022-05-29" msg="Something changed, fail from now on" delete-body-comment=true
# raise("By that time it had to be already fixed")
# GIT-COMMAND-ADD

Basically, it's a code comment with some sort of git command that needs to be executed automatically some time in the future and committed(e.g. as a feature-branch/pull-request).

Is there an existing Github Action for such need or any other alternative solution?



Solution 1:[1]

No, there isn't a built-in solution in git alone.


I would place this kind of task in an issue tracker (e.g: "review that code by 2022-05-29") or have a delayed task (I'm thinking: outside of git) that sends a reminder at that date.

If you want your CI to trigger a flag : why not code it in your language, within a test ?

if (date() >= "2022-05-29") {
    raise("do we still use that overriden value ? it should have been fixed by now")
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LeGEC