Skip to content

Implement recalculate-start-date workflow to re-anchor all Issue start dates from Project start date - #1

Draft
dte005 with Copilot wants to merge 5 commits into
mainfrom
copilot/ella-4-implement-recalculate-start-date-workflow
Draft

Implement recalculate-start-date workflow to re-anchor all Issue start dates from Project start date#1
dte005 with Copilot wants to merge 5 commits into
mainfrom
copilot/ella-4-implement-recalculate-start-date-workflow

Conversation

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown

This PR replaces the recalculate-start-date.yml stub with a full GitHub Actions workflow for project ella-system / project #4. The workflow reads Project start date, computes the offset vs. the earliest Issue start, and shifts all Issue start values accordingly.

  • Workflow trigger and configuration

    • Added scheduled execution every 15 minutes plus workflow_dispatch.
    • Configured required env vars:
      • GH_TOKEN: ${{ secrets.PROJECT_PAT }}
      • ORG: ella-system
      • PROJECT_NUMBER: 4
      • PROJECT_START_FIELD_NAME: Project start date
      • START_FIELD_NAME: Issue start
  • Data collection (paginated GraphQL)

    • Fetches project metadata and validates required field IDs.
    • Iterates project items with first:100 + cursor pagination.
    • Reads per-item fieldValueByName for both:
      • Project start date (uses first non-null value as reference date)
      • Issue start
  • Re-anchor algorithm

    • Finds minimum valid Issue start across all items.
    • Computes OFFSET_DAYS = project_start_date - min(issue_start).
    • Exits early (no-op) when:
      • Project start date is unset
      • no items have valid Issue start
      • OFFSET_DAYS == 0
  • Item updates and operational behavior

    • Updates Issue start only when computed value differs from current value.
    • Tracks and logs counters for total, eligible, updated, unchanged, missing, invalid, and error cases.
    • Handles invalid item dates gracefully (warn + skip, without aborting full run).
  • Security hardening

    • Added explicit permissions: {} at workflow level.
# Core update pattern used by the workflow
mutation($project:ID!, $item:ID!, $field:ID!, $date:Date!) {
  updateProjectV2ItemFieldValue(input:{
    projectId:$project
    itemId:$item
    fieldId:$field
    value:{ date:$date }
  }) {
    projectV2Item { id }
  }
}

Copilot AI changed the title [WIP] Implement workflow to recalculate start date Implement recalculate-start-date workflow to re-anchor all Issue start dates from Project start date Jul 12, 2026
Copilot AI requested a review from dte005 July 12, 2026 21:54
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.

2 participants