Fix work items fixed dates inconsistency
What does this MR do and why?
Related to #477496 (closed)
To match the behaviour seen in legacy epics, the attributes dates_source.start_date
and dates_source.due_date
should be updated to match the respective *_date_fixed
field when dates are changes to be fixed.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- In rails console enable the feature flags
Feature.enable(:work_item_epics) Feature.enable(:work_item_epics_rollout) Feature.enable(:work_items_rolledup_dates)
- Visit a group and create a new epic with fixed dates
- Open the new open and change the dates to Inherited. The dates will now be
None
because the epic has no children. - Change the dates back to Fixed, the dates should change back to the original value set during creation
- Visit
http://127.0.0.1:3000/-/graphql-explorer
and use the following queries to verify that the valuesstart_date
anddue_date
are set correctly for the legacy epic and the synced work item:
work item dates query
query getWorkItemInSync {
workspace: group(fullPath: "<GROUP_PATH>") {
workItems(iid: "<EPIC_IID>") {
edges {
node {
widgets {
... on WorkItemWidgetRolledupDates {
startDate
startDateFixed
startDateIsFixed
dueDate
dueDateFixed
dueDateIsFixed
}
... on WorkItemWidgetStartAndDueDate {
startDate
dueDate
}
}
}
}
}
}
}
response
{
"data": {
"workspace": {
"workItems": {
"edges": [
{
"node": {
"widgets": [
{
"startDate": "2024-08-01",
"startDateFixed": "2024-08-01",
"startDateIsFixed": true,
"startDateSourcingMilestone": null,
"dueDate": "2024-08-31",
"dueDateFixed": "2024-08-31",
"dueDateIsFixed": true,
"dueDateSourcingMilestone": null
},
{
"startDate": "2024-08-01",
"dueDate": "2024-08-31"
}
]
}
}
]
}
}
}
}
work item dates query
query getEpicInSync {
group(fullPath: "<GROUP_PATH>") {
epics(iid: "<EPIC_IID>") {
edges {
node {
startDate
startDateFixed
startDateIsFixed
dueDate
dueDateFixed
dueDateIsFixed
}
}
}
}
}
response
{
"data": {
"group": {
"epics": {
"edges": [
{
"node": {
"startDate": "2024-08-01",
"startDateFixed": "2024-08-01",
"startDateIsFixed": true,
"startDateFromInheritedSource": null,
"dueDate": "2024-08-31",
"dueDateFixed": "2024-08-31",
"dueDateIsFixed": true,
"dueDateFromInheritedSource": null
}
}
]
}
}
}
}
Edited by Eugenia Grieff