[WIP] variant vs. tag vs. config.tag clean-up#1398
Closed
Conversation
added 6 commits
July 14, 2019 22:53
This commit removes the 'tag' flag from the public documentation and adds the `variant` flag to every service command that has it. Additionally, it requires that users not set both flags via the `'exclusive'` option.
This will allow us to set variant = config.tag || flags.variant || flags.tag everywhere
We always want the flag to override the config, so we should actually have something along the lines of variant = flags.variant || flags.tag || config.tag || 'current' but it was a nice thought.
I'm not entirely sure what's going on here with respect to tags, variants, etc. and how the config interacts with the flags, and it's not like this is tested, so this is somewhat of a shot in the dark. Feel free to revert these commits, but I think a follow-up should add 'variant' as an option in the apollo.config.js and throw an error when both variant and tag are set. In general, I think we should be consistent in looking to `flags.variant || flags.tag || config.tag || 'current', which I think `config.tag` started to do by defining a getter and having it always fall back on 'current', but there was some black magic there, so I kind of just threw certain truth at the problem rather than thinking through what a nice way to share this logic would be. Hopefully this is at least minorly useful, even if it needs to be undone and refactored.
--federated flag
4 tasks
Contributor
Author
|
Closing this out due to bitrot 🤖 |
4 tasks
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.
This PR started out trying to do something about
service:deletestill requiring--federated, but then got super distracted and tried to clean up all of theflags.variantvs.flags.tagnonsense, but in a probably not super-productive way. I'm not sure how useful those commits are, so we can certainly revert them if we have another solution for this, but consistency is key, and it's something we're sorely lacking here. Leaving this open for now as a point of discussion rather than as an intended solution. I'm hoping someone who understands the nuances better can pick this up :)TODO:
*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.