Skip to content

Conversation

@TooAngel
Copy link
Contributor

Problem

Currently, the drift detection CI passes when repositories with Origin field are added to REPOSITORIES.md, even though:

  • The repository doesn't exist in the org yet
  • The transfer automation is not implemented
  • The PR can't actually be executed successfully

This is misleading because the CI shows green but the PR represents actual drift that should block merging.

Root Cause

In scripts/detect-drift.js, the hasDrift calculation excluded pendingTransfer:

// Note: pendingTransfer is informational, not an error
const hasDrift = drift.missing.length > 0 ||
                 drift.extra.length > 0 ||
                 drift.descriptionDiff.length > 0 ||
                 drift.topicsDiff.length > 0;
// pendingTransfer was NOT included!

Repositories with Origin field were added to drift.pendingTransfer and then skipped all other checks (including the "missing" check), so they never caused the CI to fail.

Solution

Update the drift detection logic to:

  1. Include pendingTransfer in hasDrift calculation - Causes CI to fail when transfer automation is not ready
  2. Update messaging - Change from warning (⚠️) to error (❌) to reflect blocking behavior
  3. Clarify comments - Update code comments to reflect that pending transfers now block CI

Changes

// Exit with error code if drift detected (useful for CI)
// Note: pendingTransfer blocks CI until transfer automation is implemented
const hasDrift = drift.missing.length > 0 ||
                 drift.extra.length > 0 ||
                 drift.descriptionDiff.length > 0 ||
                 drift.topicsDiff.length > 0 ||
                 drift.pendingTransfer.length > 0;  // <-- Added

// Warn about pending transfers (causes CI to fail)
if (drift.pendingTransfer.length > 0) {
  console.error('\n❌ Error: Repository transfer feature is under development');  // ⚠️ -> ❌
  console.error('   This PR will be blocked until transfer automation is complete');

Impact

After this fix:

  • ✅ PRs with Origin field will fail CI until transfer automation is complete
  • ✅ Clear error messaging explains why the PR is blocked
  • ✅ Prevents misleading "green CI" when PRs can't actually be executed
  • ✅ Aligns with existing documentation that says "PRs with Origin field will be blocked"

Testing

This fix can be tested with PR #12 which adds a repository with Origin field:

  • Before this fix: CI passes (incorrect)
  • After this fix: CI should fail with clear error message (correct)

Related

Update drift detection to fail CI checks when repositories with Origin
field are present, since the transfer automation is not yet implemented.

Previously, pending transfers were treated as "informational only" and
the CI would pass even though the PR couldn't be executed. This was
misleading because:
- The repository doesn't exist in the org yet
- The transfer can't be performed (API not implemented)
- The PR represents actual drift that should block merging

Changes:
- Include pendingTransfer in hasDrift calculation
- Update error messages to reflect blocking behavior
- Change warning icon (⚠️) to error icon (❌) for clarity

This ensures PRs with Origin field will properly fail CI until the
transfer automation is complete, preventing confusion about whether
the PR can actually be merged and executed.
@worlddriven
Copy link
Contributor

worlddriven bot commented Nov 27, 2025

🤖 Worlddriven Status

📊 Live Status Dashboard

🗓️ Merge Date: 2025-11-29 at 16:19:45 UTC (today)
📅 Started: 2025-11-27 at 20:41:35 UTC
Speed Factor: 0.18 (82% faster due to reviews)
Positive votes: 9/11 contribution weight (coefficient: 0.82)
📈 Base Merge Time: 10 days → Current: 2 days

🎯 Want to influence when this merges?

Your review matters! As a contributor to this project, your voice helps determine the merge timeline.

How to review:

  1. Check the changes
    Files changed

  2. Leave your review
    Review changes

Your options:

  • ✅ Agree & Speed Up: Approve Approving makes this merge faster
  • ❌ Disagree & Slow Down: Request changes Requesting changes delays the merge

💡 Pro tip: The more contributors who agree, the faster this gets merged!

📊 View detailed stats on the dashboard

📋 Recent Activity

2025-11-27, 20:41:42 - Pull request opened
2025-11-27, 20:41:44 - Pull request opened
2025-11-29, 16:51:53 - Pull request merged by worlddriven ✅


This comment is automatically updated by worlddriven

@worlddriven worlddriven bot merged commit 89a7e14 into worlddriven:main Nov 29, 2025
3 checks passed
@TooAngel TooAngel deleted the fix/drift-detection-fail-on-pending-transfer branch November 30, 2025 06:17
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.

1 participant