Repository navigation
Set the parent of an existing team that has none - #311
Draft
parkerbxyz wants to merge 2 commits into
Draft
parkerbxyz wants to merge 2 commits into
parkerbxyz wants to merge 2 commits into
Conversation
read_team copied the parent from the entitlement file into the current state when GitHub or the predictive cache didn't report one. The diff and sync_team then saw no parent change, so the parent was never set. - API reads now use the parent GitHub reports, including nil. - Cached reads now go to the API when the entitlement wants a parent and the cache doesn't record one. Fixes #309
The fake API looked up the parent with a symbol key on string-keyed JSON, so it never reported a parent. The old read_team behavior hid this. Read the parent correctly, use null for teams without one, and check the child-team parent change in the modify-and-delete run.
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.
Fixes #309.
When an existing team had no parent,
read_teamcopied the parent from the team's entitlement file into the team's current state. The provider diff andsync_teamthen saw no parent change, so the parent was never set and nothing was logged.Changes
nil. Other entitlement metadata is kept, and anilmetadata hash is handled.parent_team_name,read_teamreads the team from the API instead. A cache entry that records a parent is used as before. If it differs from the entitlement, the provider's existing diff flow refreshes it from the API."nil"as a string. The oldread_teambehavior hid both. The fake API now reports parents, and the modify-and-delete run checks the realchild-teamparent change fromemployeestogrumpy-cat, which raises its change count from 28 to 29.This doesn't change how
update_teamhandles errors or howsync_teamcounts a failed parent update. That's tracked in #6.Cache entries saved before this fix
Predictive cache snapshots are written from each team's declared metadata, so an entry can record a parent the team doesn't have. The plugin can't tell those entries apart. To correct affected teams, run Entitlements once with
--full.Tests
read_team: an API read for a team with no parent, an API read with no entitlement metadata, and cached metadata that'snil, has no parent key, records no parent, or records the parent.read_team,diffandcommitfor a parent-only change: with no cache, with a cache that doesn't record a parent, and with a cached parent that differs, both when the API has no parent and when it already has the desired parent. They also check that the API is read only once, that the update uses the real team ID, and that parent removal is still ignored.script/test -d -kpasses with 100% coverage,rubocopreports no offenses, and the acceptance suite passes in CI.