Commit Graph

8 Commits

Author SHA1 Message Date
Bo-Yi Wu 627e233cc6 feat: add configurable Jenkins job wait and polling support (#40)
- Add support for waiting for Jenkins job completion with polling and timeout options
- Introduce flags and environment variables to control wait behavior, poll interval, and timeout
- Refactor the Jenkins job trigger to return queue item ID and enable job status tracking
- Implement functions for querying queue items and build status, including waiting until a build completes or times out
- Update CLI, plugin, and documentation to explain new job wait and polling capabilities
- Extend tests to cover queue item parsing, build info retrieval, and job completion scenarios with success, failure, and timeouts

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-12-01 21:53:42 +08:00
Bo-Yi Wu cda84c122e feat: refactor plugin config validation and enhance job error handling
- Refactor plugin configuration validation into a dedicated method with improved error messages
- Add utility functions for trimming whitespace from slices and parsing key=value parameters
- Improve error handling for missing or invalid job names and parameters
- Enhance Exec to validate configuration, clean job list, and parse parameters before triggering jobs
- Update job triggering to provide more descriptive error reporting
- Replace deprecated and less precise test assertions with more explicit ones
- Add extensive unit tests for configuration validation, whitespace trimming, parameter parsing, and job triggering (including multiple jobs, parameters, remote token, and job lists with whitespace)
- Improve test coverage and reliability for plugin behavior and edge cases

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-12-01 17:39:36 +08:00
appleboy 4f822500f2 style: refactor codebase for improved consistency and clarity
- Reorder imports in `jenkins_test.go` and `plugin_test.go` to move `assert` import to the end
- Remove unnecessary empty line in `plugin.go`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-10-04 15:22:05 +08:00
Bo-Yi Wu 7ba6170e12 fix: show error if missing jobs. 2017-01-16 15:04:12 +08:00
Bo-Yi Wu 788418c56f refactor: remove unnecessary config. (#5) 2017-01-16 10:42:55 +08:00
Bo-Yi Wu 92fd06c78a Add plugin testing.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-10-15 23:44:11 +08:00
Bo-Yi Wu 44d62cead6 add main config.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-10-15 19:12:29 +08:00
Bo-Yi Wu 74735d5fa4 initial file
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-10-15 13:30:34 +08:00