Repository navigation
Add a sync of shared fields across the Interra boards - #1
Merged
Merged
Conversation
I want the fields that the Interra boards, the PROTEUS roadmap and the issues share to stay equal, so that a change in one place shows up in the others. Start date, target date and priority are synced in all four places: the Interra Management board, the Interra Collaboration board, the PROTEUS roadmap and the org issue fields of each issue. Workload is synced on the three boards and sets the Effort issue field, and status, category, sub-team and release are synced between the two Interra boards. The package reads all places, decides per issue and field which value changed last, and writes that value to the other places. A state file in a private repository records what each place showed in the previous run, so a cleared value can be told apart from one that was never set. A scheduled workflow runs it every 30 minutes as a GitHub App; the public log shows counts, field names and error types only.
A NOT_FOUND error deeper in a board read could null a value, which would then read as empty and spread as a clear. The board read now accepts NOT_FOUND only at the board or org itself, which is how a missing board answers. The tests also check that the page cursor is passed on, and the README setup step names the protection rule this repository uses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds a small Python package and a scheduled workflow that keep shared fields equal across the Interra Management board, the Interra Collaboration board, the PROTEUS Development Roadmap and the org issue fields of each issue. When a value changes in one place, the next run writes it to the others.
Why
The same dates, priorities and statuses are kept by hand on three boards and on the issues themselves, and they drift apart. The roadmap views are only useful when start and target dates agree everywhere.
Changes
board_sync/core.py: the sync rules. Newest change wins; a value that every place already shows wins without a conflict; a missing field, a field created again or an emptied field never clears the other places; an issue that leaves a board and comes back starts from its old record.board_sync/github.py: GraphQL reads of the three boards and of the org issue fields, with change times from the issue timeline, and the four write mutations. Retries on server errors, network errors and rate limits; a list longer than one page stops the read.board_sync/__main__.py: dry run by default; with--applya run stops above 20 new writes until a person approves the plan, puts writes that failed before last, parks writes that keep failing, saves its state even when it is cut short, and prints only counts, field names and error types to the log.scripts/store_state.sh: stores the state, snapshot and report of a run in the privateboard-sync-staterepository; the files of the run replace the stored ones whole..github/workflows/sync.yml: runs every 30 minutes onmainas a GitHub App and pins every action by commit..github/workflows/tests.yml: lint and tests on every pull request, with a coverage floor of 95%.README.md: the rules, the setup and the exit codes..gitignorekeeps local run files with private board data out of commits.Testing