This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 404
Repository state machine #654
Merged
smashwilson
merged 107 commits into
aw-single-project-regression
from
aw-go-go-gadget-repository-state-machine
Apr 20, 2017
Merged
Repository state machine #654
smashwilson
merged 107 commits into
aw-single-project-regression
from
aw-go-go-gadget-repository-state-machine
Apr 20, 2017
Conversation
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
…to aw-go-go-gadget-repository-state-machine
This was referenced Apr 22, 2017
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Don't worry, this doesn't really have 75+ commits, it just builds on top of #633.
Refactor the
Repository
model into a state machine. This will fix #608 by allowing us to render distinct things depending on more granular information thanthis.props.repository === null
and simplify a bunch of code because we can ensure we always have a non-nullRepository
instance available.Here's the state hierarchy:
State
Undetermined
Absent
Loading
Initializing
Cloning
Empty
Present
Destroyed
Countdown to Blastoff 🚀
State
class hierarchy.State
that provide default behavior for visible methods: returning empty collections or null objects for accessors, throwing an Error for action methods.State
methods intended to be used from aRepository
with a@shouldDelegate
decorator.State
subclass. Most ofRepository
moves toPresent
.State
subclasses to transition to one another by constructor name (to avoid circular dependencies).Loading
) to encapsulate the states.Absent
state to represent a missing working directory.Repository
.Repository
instances in their initial state.Promise
that can be used to wait for a loading repository to complete.this.state
.@shouldDelegate
decorations.Repository
tests to accommodate the state transition model.Branch
,Remote
, andCommit
.State
andPresent
.githubInfoFromRemote
.Repository
constructor inWorkdirContext
.repository
as.isRequired
in our PropTypes.GitTabController
differently depending on the current repository state.isEmpty()
.isLoading()
.isPresent()
.Undetermined
state that's used when activated without any projects in the workspace. It should automatically transition toAbsent
after a delay if no projects are loaded.StatusBarTileController
differently depending on the current repository state.init
orclone
from theAbsent
state.atom.getLoadSettings()
to determine whether theUndetermined
state acts like aLoading
state or anAbsent
one.