[SERVER-56216] Commit queue should verify no open TODOs in code Created: 05/Apr/21  Updated: 29/Oct/23  Resolved: 03/May/21

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.9.0-rc1, 4.4.7, 5.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: David Bradford (Inactive)
Resolution: Fixed Votes: 2
Labels: dp-qp-stakeholder-request-2021-04, dp-qp-stakeholder-request-2021-07
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-57777 TODO checker needs to be able to be d... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.9, v4.4
Sprint: DAG 2021-05-03, DAG 2021-05-17
Participants:
Story Points: 2

 Description   

There is a Jira TODO bot that scrapes the codebase for TODOs that reference closed tickets. Frequently, I don't find out about these TODOs until I have already closed the ticket. It then takes time to triage the ticket, etc.

It would be extremely useful to have a commit-queue task (or even a sometimes-enabled patch build task) as a line of defense. It should fail when there is an outstanding TODO in the code that references your ticket number. I don't know what the current bot does. We should check with the TPMs for the current script.

I assume it just uses a regex like this: TODO.*<ticket>



 Comments   
Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-56216: Don't look at git metadata when checking for todo comments

(cherry picked from commit e33ea913e252228b4b6a158b74bdab2c1a301f1e)
(cherry picked from commit db4e97e3cc339ac406cf579a37922310db7601ee)
Branch: v4.4
https://github.com/mongodb/mongo/commit/7dbfa3f3c2f9fa105a78094d7f58cd33bd60bdd8

Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-56216: Add commit-queue checks for unresolved TODOs

(cherry picked from commit 272b9e0bd2425ae15766b198de0f6a1a522bf8d3)
(cherry picked from commit a8782fc7ea197dd31964be8f238c618d9a776a01)
Branch: v4.4
https://github.com/mongodb/mongo/commit/82997e89d49be1c031b99a0feb6cc30366fe7d3f

Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-56216: Don't look at git metadata when checking for todo comments

(cherry picked from commit e33ea913e252228b4b6a158b74bdab2c1a301f1e)
Branch: v4.9
https://github.com/mongodb/mongo/commit/db4e97e3cc339ac406cf579a37922310db7601ee

Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-56216: Add commit-queue checks for unresolved TODOs

(cherry picked from commit 272b9e0bd2425ae15766b198de0f6a1a522bf8d3)
Branch: v4.9
https://github.com/mongodb/mongo/commit/a8782fc7ea197dd31964be8f238c618d9a776a01

Comment by Githook User [ 04/May/21 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-56216: Don't look at git metadata when checking for todo comments
Branch: master
https://github.com/mongodb/mongo/commit/e33ea913e252228b4b6a158b74bdab2c1a301f1e

Comment by David Bradford (Inactive) [ 03/May/21 ]

ian.whalen I just enabled it in the commit-queue, so we might want to let your script run one more time, in case there were any TODO comments added since the last run.

Since this is part of the commit-queue it is taking a little different approach than your script. Namely, it is looking for TODO comments that reference the ticket that the commit(s) under test are targeting. It is not checking Jira for closed commits.

Because of that there are a few possible edge cases that the new tool would miss.

  • Someone adds a new comment references a ticket that is already closed.
  • A ticket in Jira that has outstanding TODO comments is closed without any code changes.
Comment by Ian Whalen (Inactive) [ 03/May/21 ]

woohoo, thanks david.bradford! So at this point am I right in thinking that we can turn off the thing to generate TODO tickets since in theory we should have no knew instances that actually trigger it to create any tickets?

Comment by Githook User [ 30/Apr/21 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-56216: Add commit-queue checks for unresolved TODOs
Branch: master
https://github.com/mongodb/mongo/commit/272b9e0bd2425ae15766b198de0f6a1a522bf8d3

Comment by David Bradford (Inactive) [ 20/Apr/21 ]

I think this makes sense as DAG work. Feel free to send it over.

Comment by Ian Whalen (Inactive) [ 20/Apr/21 ]

oof, I hate to play hot potato with your ticket louis but I really don't think evergreen yaml is something the TPMs have the background to implement. I'm happy to delete the cron'd bot after we have the commit task!

david.bradford maybe before I bounce this to the DAG team - does it map to your team to implement this? if not I think I'm just locking you and Robert in a room until I get a clear home for "new evg tasks that affect all of server"

(leaving in NT pending outcome of this thread.)

Comment by Louis Williams [ 20/Apr/21 ]

Agreed that the result of this ticket would be to eliminate the TODO bot. I'll let the TPM team decide whether or not this request lands in their area of ownership.

Comment by Robert Guo (Inactive) [ 20/Apr/21 ]

louis.williams My understanding is that this can replace the current TODO bot. If the new commit queue task creates the Jira tickets or prevents TODOs from being committed, then there would be no need for the current bot. Let me know if you had some else in mind.

The DAG team maintains core commit queue functionality and I cc'd them in my comment above to facilitate the mechanics of adding the task(s).

Comment by Louis Williams [ 20/Apr/21 ]

robert.guo, this doesn't sound like something for the TPM team to do. They own the TODO bot, but are they historically responsible for creating Evergreen tasks in the server project? This would be entirely independent of the TODO bot.

Comment by Robert Guo (Inactive) [ 19/Apr/21 ]

Moving this to the TpM backlog sine they wrote the TODO bot.

I think this may require some coordination with DAG as well for changes to the commit queue (cc david.bradford ).

Comment by Louis Williams [ 06/Apr/21 ]

Since this bot first started running in July 2019, it has opened 338 tickets for unresolved TODOs, according to this Jira filter.

Generated at Thu Feb 08 05:38:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.