Extract the shared git auth capability - #84
Merged
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
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.
Why
The last feature-to-feature dependency:
:feature:settingsimported:feature:git's internal auth plumbing —GitAuthController,GitHubAuthDialog,GitAuthPromptState,GitAuthPromptActionsandGitAuthMode.The obvious fix would have been to export those from
:feature:git:api, and it would have been wrong. Settings is not asking git to perform an operation. Both features reuse the same auth capability: git needs it when a push hits a 401, settings needs it so you can connect an account up front. Exporting one feature's internals to the other would have blessed the accidental coupling, and it would have dragged:designsysteminto a contract module that is otherwise restricted to:domain.What changed
New
:core:gitauth, owning the capability both features share:GitAuthController— the auth state machineGitAuthPromptState,GitAuthPromptActions,GitAuthMode,GitHubDeviceCodeUiGitHubAuthDialoggit_auth_*string resources, which had to move with the dialogGitAuthControllercharacterization tests:feature:settingsnow depends on:core:gitauthand no longer on:feature:gitat all.:feature:gitdepends on it too, as one consumer among two rather than the owner.It is a
:core:module rather than a contract module because it carries UI. That is the honest distinction::feature:*:apimodules hold contracts and may only see:domain; a capability module is shared implementation and may use the design system.The module boundary baseline is now empty. Every feature-to-feature dependency introduced before this migration has been removed, and the check runs with zero tolerated exceptions.
Behavior
No behavior change. Code moved between modules; no logic altered.
Scope
GitHubAuthDialog's existingLongMethodandCyclomaticComplexMethodfindings moved with it as baseline entries rather than being regenerated. They were already baselined in:feature:git; splitting the dialog is separate work.Tests
GitAuthControllercharacterization tests moved with the controller and pass unchanged. They were written for exactly this refactor — they pin the device-flow ordering, the 1100 ms deferred close, cancellation, and the re-entrancy quirk, so this move is provably behaviour-preserving rather than merely compiling.Verification
./gradlew test detekt verifyModuleBoundaries :app:assembleDebug— BUILD SUCCESSFUL. Boundary report: 136 dependencies checked, 0 baseline entries, 0 violations.Verified on an emulator, with attention to the resource move, since
android.nonTransitiveRClass=truemeans a string left behind would fail at runtime rather than at build time:action_cancelfrom:core:commonResources$NotFoundException,AbstractMethodErrororNoClassDefFoundErrorin logcat