Skip to content

Add force push prevention checks for pull requests#367

Draft
jayam04 wants to merge 1 commit into
oppia:masterfrom
jayam04:block-force-push
Draft

Add force push prevention checks for pull requests#367
jayam04 wants to merge 1 commit into
oppia:masterfrom
jayam04:block-force-push

Conversation

@jayam04
Copy link
Copy Markdown
Member

@jayam04 jayam04 commented Apr 24, 2026

Explanation

Checklist

@jayam04 jayam04 requested a review from a team as a code owner April 24, 2026 05:42
@jayam04 jayam04 requested review from U8NWXD and removed request for a team April 24, 2026 05:42
@jayam04 jayam04 marked this pull request as draft April 24, 2026 05:47
@jayam04 jayam04 linked an issue Apr 25, 2026 that may be closed by this pull request
@jayam04
Copy link
Copy Markdown
Member Author

jayam04 commented Apr 27, 2026

Matrix Testing

  1. Error logs from the Oppiabot
    [@octokit/app] Deprecated. Use @octokit/app-auth instead. See https://github.com/octokit/app.js/#deprecated
    (node:429126) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    New Relic for Node.js was unable to bootstrap itself due to an error:
    Error: New Relic requires that you name this application!
    Set app_name in your newrelic.js or newrelic.cjs file or set environment variable
    NEW_RELIC_APP_NAME. Not starting!
        at createAgent (/home/jayampatel/oppiaroot/oppiabot/node_modules/newrelic/index.js:146:11)
        at initialize (/home/jayampatel/oppiaroot/oppiabot/node_modules/newrelic/index.js:87:15)
        at Object.<anonymous> (/home/jayampatel/oppiaroot/oppiabot/node_modules/newrelic/index.js:37:3)
        at Module._compile (node:internal/modules/cjs/loader:1565:14)
        at Object..js (node:internal/modules/cjs/loader:1708:10)
        at Module.load (node:internal/modules/cjs/loader:1318:32)
        at Function._load (node:internal/modules/cjs/loader:1128:12)
        at TracingChannel.traceSync (node:diagnostics_channel:322:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
        at Module.require (node:internal/modules/cjs/loader:1340:12)
        at require (node:internal/modules/helpers:138:16)
        at Object.<anonymous> (/home/jayampatel/oppiaroot/oppiabot/index.js:19:1)
        at Module._compile (node:internal/modules/cjs/loader:1565:14)
        at Object..js (node:internal/modules/cjs/loader:1708:10)
        at Module.load (node:internal/modules/cjs/loader:1318:32)
        at Function._load (node:internal/modules/cjs/loader:1128:12)
        at TracingChannel.traceSync (node:diagnostics_channel:322:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
        at Module.require (node:internal/modules/cjs/loader:1340:12)
        at require (node:internal/modules/helpers:138:16)
        at exports.resolve (/home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/resolver.js:11:12)
        at Probot.load (/home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/index.js:218:32)
        at /home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/index.js:239:78
        at Array.forEach (<anonymous>)
        at Probot.setup (/home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/index.js:239:38)
        at Function.<anonymous> (/home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/index.js:188:32)
        at step (/home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/index.js:33:23)
        at Object.next (/home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/index.js:14:53)
        at fulfilled (/home/jayampatel/oppiaroot/oppiabot/node_modules/probot/lib/index.js:5:58)
    

Testing Steps

  1. Created 12 branches with conflicts in 1 new file.
  2. Pushed 10 branches with conflicts. (And opened PRs -- 10 with conflicts and 2 older ones).
  3. Ran Oppiabot locally.
  4. RESULT: The required label was added to all 10 branches.
    image
  5. Merged the development locally and fixed conflicts. Then, pushed the changes.
  6. RESULT: The label was removed.
    image
  7. Stopped Oppiabot
  8. Fixed conflicts in 3 branches and pushed the changes.
  9. RESULT: No labels removed.
  10. Started Oppiabot
  11. RESULT: Oppiabot didn't remove the label.
    image
  12. While Oppiabot is running, resolved the merge-conflict in one branch and pushed the changes.
  13. RESULT: Oppiabot removed the merge-conflict label (check Branch 5).
    image
  14. Created a new PR with exisiting conflicts when Oppiabot was already running.
  15. RESULT: Oppiabot didn't add the merge-conflict label.
    image

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.

Close PR on a force-push

2 participants