Skip to content

Conversation

@HeZephyr
Copy link
Member

No description provided.

@HeZephyr HeZephyr self-assigned this May 24, 2025
@HeZephyr HeZephyr requested a review from Copilot May 24, 2025 03:34
@HeZephyr HeZephyr merged commit 7c01daf into main May 24, 2025
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR releases version 1.0.0 with new features to collect and expose additional system and build metrics from Bamboo.

  • Added new build metrics (success, failure, build count) and their collection in collector/collector.go.
  • Updated documentation and CI/CD workflows to support auto release and continuous integration.
  • Enhanced the main exporter to expose a Prometheus metrics endpoint.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
collector/collector.go Adds build metrics, new response type, and updates metric collection.
bamboo_exporter.go Minor update: adds a comment for exposing the metrics endpoint.
README.md Updates documentation to reflect new features and usage instructions.
.github/workflows/release.yml Introduces an auto release workflow; includes version validation.
.github/workflows/ci.yml Adds a CI workflow to run tests, vet, and format checks.


if err := e.scrapeBuildResults(); err != nil {
e.logger.Error("Failed to scrape build results", "error", err)
e.failures.Inc()
Copy link

Copilot AI May 24, 2025

Choose a reason for hiding this comment

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

The code increments 'e.failures' on scrapeBuildResults error, but no such metric is defined; consider changing this to 'e.buildFailure.Inc()'.

Copilot uses AI. Check for mistakes.
echo "Version in file: $CURRENT_VERSION"
# 验证版本格式 (x.y.z)
if ! echo "$CURRENT_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+
Copy link

Copilot AI May 24, 2025

Choose a reason for hiding this comment

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

The grep pattern for version validation is incomplete and missing the closing delimiter; please complete the regular expression to properly match the x.y.z pattern.

Suggested change
if ! echo "$CURRENT_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+
if ! echo "$CURRENT_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +114
done; then
echo "❌ Invalid version format in VERSION file: $CURRENT_VERSION"
echo "Expected format: x.y.z (e.g., 1.0.0)"
exit 1
Copy link

Copilot AI May 24, 2025

Choose a reason for hiding this comment

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

The syntax 'done; then' appears to be erroneous in the shell script; remove or adjust it so that the conditional structure is correctly formed.

Suggested change
done; then
echo "❌ Invalid version format in VERSION file: $CURRENT_VERSION"
echo "Expected format: x.y.z (e.g., 1.0.0)"
exit 1
done

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants