Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tag expire workflow #57

Closed
wants to merge 5 commits into from
Closed

add tag expire workflow #57

wants to merge 5 commits into from

Conversation

eumel8
Copy link
Member

@eumel8 eumel8 commented May 24, 2024

Motivation

as discussed this week, more and more tags are stored in the package repository. At this time there is no auto-mechanism to expire older tags, so I developed this action to maintain the package repo and delete older tags then 60 days.

Changes

  • generate a PAT scoped package read/write
  • added PAT to the repo
  • added scheduled workflow

Tests done

manually tested on user/org package repo, works until the last tag is only present

TODO

  • I've assigned myself to this PR

Signed-off-by: Frank Kloeker <f.kloeker@telekom.de>
Copy link

github-actions bot commented May 24, 2024

File Coverage
All files 97%
test_autoscale_resource.py 99%
test_cmd.py 100%
test_events.py 100%
test_grace_period.py 100%
test_ignore_if_labels_dont_match.py 100%
test_main.py 100%
test_pods_force_uptime.py 100%
test_resources.py 100%
test_scaler.py 95%
test_time.py 100%

Minimum allowed coverage is 70%

Generated by 🐒 cobertura-action against ab5a177

eumel8 and others added 3 commits May 24, 2024 13:20
Signed-off-by: Frank Kloeker <f.kloeker@telekom.de>
Signed-off-by: Frank Kloeker <f.kloeker@telekom.de>
@Fovty
Copy link
Member

Fovty commented May 24, 2024

ab5a177 should work when the following PR is merged: eumel8/expire-action#3

@eumel8 eumel8 marked this pull request as draft May 24, 2024 14:59
@eumel8 eumel8 marked this pull request as ready for review May 24, 2024 16:27
@eumel8 eumel8 marked this pull request as draft May 24, 2024 16:40
@eumel8
Copy link
Member Author

eumel8 commented May 24, 2024

@Fovty I tested again and ended up with errors

Run ./venv/bin/python tagexpire.py *** user busybox%2Fbusybox 0 ^(latest|dev|[0-9][0-9]\.\d+\.\d+)$ 
/home/runner/work/_temp/f7ffa51b-7a5b-4f0b-8cc2-bb31343f77c5.sh: line 1: syntax error near unexpected token `('

I think this caused by the un-escaped characters in the runner shell. A working configuration is

"^dev$\\|^latest$\\|^2.0.0$"

but that's also not so reliable

@Fovty
Copy link
Member

Fovty commented May 24, 2024

@Fovty I tested again and ended up with errors

Run ./venv/bin/python tagexpire.py *** user busybox%2Fbusybox 0 ^(latest|dev|[0-9][0-9]\.\d+\.\d+)$ 
/home/runner/work/_temp/f7ffa51b-7a5b-4f0b-8cc2-bb31343f77c5.sh: line 1: syntax error near unexpected token `('

I think this caused by the un-escaped characters in the runner shell. A working configuration is

"^dev$\\|^latest$\\|^2.0.0$"

but that's also not so reliable

Yeah, tested it right now in the shell - the error occurs, because the eval command is interpreting the special characters in the regex pattern as part of the shell command.

Had to do some escaping, but came finally to a working pattern (tested it locally).

Pattern: "^latest$\\|^dev$\\|^[0-9][0-9]\\\\.\\\\d+\\\\.\\\\d+$"

Copy link
Member

@Fovty Fovty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatives for the RegEx:

  • list of exclusions as argument
  • file in repo with exclusions

suggestions are welcome

@JTaeuber
Copy link
Member

JTaeuber commented Aug 2, 2024

Closing, since we do not plan to implement this yet.

@JTaeuber JTaeuber closed this Aug 2, 2024
@JTaeuber JTaeuber deleted the feat/tag-expire branch August 2, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants