[ca] Fix linting and test failures in CI#8579
Merged
Conversation
- Fix testifylint issues in completions_test.go (use assert.Len instead of assert.Equal for length comparisons) - Fix maintenance workflow cron schedule generation to use days instead of hours for scheduling logic - Update workflow tests to disable GitHub tools to avoid permission validation warnings - Fix add command test to expect no shorthand for --number flag (avoids conflict with logs -c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes all CI failures on the main branch discovered by the automated CI cleaner workflow.
Changes Made
1. Linting Fixes
pkg/cli/completions_test.go: Changedassert.Equal(t, len(a), len(b))toassert.Len(t, b, len(a))to use the proper testify assertion for length comparisons.2. Test Fixes
Maintenance Workflow Cron Generation
pkg/workflow/maintenance_workflow.gogenerateMaintenanceCronfunction was using hours as input but tests expected days-based schedulingGitHub Tool Permissions Validation
pkg/workflow/strict_mode_test.go,pkg/workflow/workflow_run_validation_test.gogithub: false) to avoid permission validation warnings when not testing GitHub tool functionalityAdd Command Flag Test
pkg/cli/add_command_test.go-cshorthand for--numberflag, but this conflicts with logs command's--countflag--numberflag, aligning with flag consistency rulesValidation
All tests now pass:
go fmt)prettier)golangci-lint)go test ./...)Test Results
Context
This PR was generated automatically by the CI cleaner agent (workflow run #334) which runs twice daily to maintain CI health on the main branch.