Skip to content

Conversation

sleepyStick
Copy link
Contributor

@sleepyStick sleepyStick commented Sep 22, 2025

Summary
Resync Spec task was silently failing and not generating any PRs.
https://jira.mongodb.org/browse/PYTHON-5569

Changes in this PR

  • I added a set -eu to the beginning of the bash file which should fail the task if the python script fails.
  • The cause of this specific PR was from one (or more) of the patch files being out of date. Going forward, this error is caught and the error will be put into the body of the generated PR (if all other steps succeed).
  • updated appropriate patch files and ran the script locally to sync the remaining specs.

Test Plan
I ran the script locally and verified desired behaviour. See below:
before my changes:

>$ ./.evergreen/scripts/resync-all-specs.sh 
Beginning to sync specs
Done syncing specs
Beginning to apply patches
rm: /Users/iris.ho/GitHub/mongo-python-driver/test/transactions/legacy/errors-client.json: No such file or directory
rm: /Users/iris.ho/GitHub/mongo-python-driver/test/index_management/index-rawdata.json: No such file or directory
Done removing unimplemented tests
error: patch failed: test/discovery_and_monitoring/unified/serverMonitoringMode.json:5
error: test/discovery_and_monitoring/unified/serverMonitoringMode.json: patch does not apply
Traceback (most recent call last):
  File "/Users/iris.ho/GitHub/mongo-python-driver/./.evergreen/scripts/resync-all-specs.py", line 122, in <module>
    main(args)
    ~~~~^^^^^^
  File "/Users/iris.ho/GitHub/mongo-python-driver/./.evergreen/scripts/resync-all-specs.py", line 109, in main
    apply_patches()
    ~~~~~~~~~~~~~^^
  File "/Users/iris.ho/GitHub/mongo-python-driver/./.evergreen/scripts/resync-all-specs.py", line 36, in apply_patches
    subprocess.run(
    ~~~~~~~~~~~~~~^
        ["git apply -R --allow-empty --whitespace=fix ./.evergreen/spec-patch/*"],  # noqa: S607
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        shell=True,  # noqa: S602
        ^^^^^^^^^^^^^^^^^^^^^^^^^
        check=True,
        ^^^^^^^^^^^
    )
    ^
  File "/Users/iris.ho/.pyenv/versions/3.13.5t/lib/python3.13t/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git apply -R --allow-empty --whitespace=fix ./.evergreen/spec-patch/*']' returned non-zero exit status 1.

after my changes:

>$ Beginning to sync specs
Done syncing specs
Beginning to apply patches
rm: /Users/iris.ho/GitHub/mongo-python-driver/test/transactions/legacy/errors-client.json: No such file or directory
rm: /Users/iris.ho/GitHub/mongo-python-driver/test/index_management/index-rawdata.json: No such file or directory
Done removing unimplemented tests

The following specs were changed:
 -connection_logging
 -connection_monitoring
 -csot
 -discovery_and_monitoring
 -scripts
 -server_selection_logging


The following spec syncs encountered errors:
 -applying patches
```b'error: patch failed: test/discovery_and_monitoring/unified/serverMonitoringMode.json:5\nerror: test/discovery_and_monitoring/unified/serverMonitoringMode.json: patch does not apply\n'```

Screenshots (optional)
See above?

Checklist
Do not delete the items provided on this checklist
Checklist for Author

  • Did you update the changelog (if necessary)? (not necessary this time since no public facing changes)
  • Is the intention of the code captured in relevant tests? (i think the script now behavious more like we expected it to)
  • If there are new TODOs, has a related JIRA ticket been created? (no new todos)

Checklist for Reviewer {@primary_reviewer}

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Have you checked for spelling & grammar errors?
  • Is all relevant documentation (README or docstring) updated?

Focus Areas for Reviewer
List any complex portion of code you believe needs additional scrutiny and explain why.
see comments :)


# PYTHON-5248 - Remove support for MongoDB 4.0
rm $PYMONGO/test/**/pre-42-*.json
rm $PYMONGO/test/**/**/pre-42-*.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is to remove files in test/discovery_and_monitoring/errors/pre-42-*.json
(I thought the ** was a recursive wildcard? but every time i ran the resync spec script those files would pop up so i added it explicitly?)

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Run spec syncing script and create PR
set -eu
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should make errors more visible to us

"single",
+ "sharded"
- "sharded",
- "sharded-replicaset"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already did this ticket but for whatever reason the spec repo still has this one instance of sharded-replicaset so we're applying this patch to keep it out of our tests. (I've made a comment on the drivers ticket asking why its still in the spec repo)

@sleepyStick sleepyStick marked this pull request as ready for review September 23, 2025 20:42
@sleepyStick sleepyStick requested a review from a team as a code owner September 23, 2025 20:42
@sleepyStick sleepyStick changed the title PYTHON-5569 PYTHON-5569: [Build Failure] Spec Resync job is failing silently Sep 23, 2025
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