diff --git a/.github/workflows/.placeholder b/.github/workflows/.placeholder deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/.github/workflows/auto-merge.main.yaml b/.github/workflows/auto-merge.main.yaml deleted file mode 100644 index 8eb95ae42c..0000000000 --- a/.github/workflows/auto-merge.main.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: auto-merge-main - -on: - workflow_dispatch: {} - schedule: - - cron: "*/30 * * * *" # At every 30 minutes - -jobs: - auto-approve: - runs-on: ubuntu-latest - if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere - permissions: - pull-requests: write - steps: - - name: Checkout the current repo - uses: actions/checkout@v4 - - name: auto-merge-update-references - run: | - gh auth status - git config user.name openshift-pipelines-bot - git config user.email pipelines-extcomm@redhat.com - # Approve and merge pull-request with no reviews - for p in $(gh pr list --search "author:app/red-hat-konflux head:konflux/references/main" --json "number" | jq ".[].number"); do - gh pr merge --rebase --delete-branch --auto $p - done - env: - GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} - - name: auto-merge-upstream-main - run: | - gh auth status - git config user.name openshift-pipelines-bot - git config user.email pipelines-extcomm@redhat.com - # Approve and merge pull-request with no reviews - for p in $(gh pr list --search "head:actions/update/sources-main" --json "number" | jq ".[].number"); do - gh pr merge --rebase --delete-branch --auto $p - done - env: - GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} - diff --git a/.github/workflows/auto-merge.next.yaml b/.github/workflows/auto-merge.next.yaml deleted file mode 100644 index 83cab7248b..0000000000 --- a/.github/workflows/auto-merge.next.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: auto-merge-next - -on: - workflow_dispatch: {} - schedule: - - cron: "*/30 * * * *" # At every 30 minutes - -jobs: - auto-approve: - runs-on: ubuntu-latest - if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere - permissions: - pull-requests: write - steps: - - name: Checkout the current repo - uses: actions/checkout@v4 - - name: auto-merge-update-references - run: | - gh auth status - git config user.name openshift-pipelines-bot - git config user.email pipelines-extcomm@redhat.com - # Approve and merge pull-request with no reviews - for p in $(gh pr list --search "author:app/red-hat-konflux head:konflux/references/next" --json "number" | jq ".[].number"); do - gh pr merge --rebase --delete-branch --auto $p - done - env: - GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} - - name: auto-merge-upstream-next - run: | - gh auth status - git config user.name openshift-pipelines-bot - git config user.email pipelines-extcomm@redhat.com - # Approve and merge pull-request with no reviews - for p in $(gh pr list --search "head:actions/update/sources-next" --json "number" | jq ".[].number"); do - gh pr merge --rebase --delete-branch --auto $p - done - env: - GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} - diff --git a/.github/workflows/update-sources.main.yaml b/.github/workflows/update-sources.main.yaml deleted file mode 100644 index 155b83f9ff..0000000000 --- a/.github/workflows/update-sources.main.yaml +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by openshift-pipelines/hack. DO NOT EDIT. -name: update-sources-main - -on: - workflow_dispatch: {} - schedule: - - cron: "30 */12 * * *" # At minute 30 past every 12th hour. - -jobs: - - update-sources: - runs-on: ubuntu-latest - if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout the current repo - uses: actions/checkout@v4 - with: - ref: main - - - name: Clone tektoncd/chains - run: | - rm -fR upstream - git clone https://github.com/tektoncd/chains upstream - pushd upstream - git checkout -B main origin/main - popd - - - name: Commit new changes - run: | - git config user.name openshift-pipelines-bot - git config user.email pipelines-extcomm@redhat.com - git checkout -b actions/update/sources-main - pushd upstream - OLD_COMMIT=$(cat ../head) - NEW_COMMIT=$(git rev-parse HEAD) - echo Previous commit: ${OLD_COMMIT} - git show --stat ${OLD_COMMIT} - echo New commit: ${NEW_COMMIT} - git show --stat ${NEW_COMMIT} - git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt - git rev-parse HEAD > ../head - popd - rm -rf upstream/.git - git add upstream head .konflux - - if [[ -z $(git status --porcelain --untracked-files=no) ]]; then - echo "No change, exiting" - exit 0 - fi - - git commit -F- < /tmp/diff.txt - git rev-parse HEAD > ../head - popd - rm -rf upstream/.git - git add upstream head .konflux - - if [[ -z $(git status --porcelain --untracked-files=no) ]]; then - echo "No change, exiting" - exit 0 - fi - - git commit -F- < float64(r.config.MaxQueueDepth) { + logger.Warnf("Queue depth (%f) exceeds recommended maximum (%d)", currentDepth, r.config.MaxQueueDepth) + } + + metrics.Record(ctx, queueDepth.M(currentDepth)) + logger.Debugf("Recorded queue depth: %f", currentDepth) +} + +// RecordAttestationGeneratedMetrics records successful attestation generation +func (r *Recorder) RecordAttestationGeneratedMetrics(ctx context.Context) { + logger := logging.FromContext(ctx) + if !r.initialized { + logger.Errorf("Ignoring attestation metrics recording as recorder not initialized") + return + } + + metrics.Record(ctx, attestationGeneratedCount.M(1)) + logger.Debugf("Recorded attestation generation metric") +} + +// UpdateMetricsConfig updates the recorder's configuration +func (r *Recorder) UpdateMetricsConfig(ctx context.Context, config *MetricsConfig) { + logger := logging.FromContext(ctx) + if config == nil { + logger.Warn("Attempted to update with nil config, using default") + config = DefaultMetricsConfig() + } + + r.config = config + logger.Debugf("Updated metrics config: detailed=%v, interval=%d, maxQueue=%d", + config.EnableDetailedMetrics, config.MeasurementInterval, config.MaxQueueDepth) +} + +// MetricOperation represents a single metrics operation for batch processing +type MetricOperation struct { + Type string // "count", "error", "duration", "retry", "queue", "attestation" + MetricType string // specific metric type identifier + Value float64 // value for duration/queue metrics (ignored for count/error/retry/attestation) +}