Skip to content

[WIP] variant vs. tag vs. config.tag clean-up#1398

Closed
zionts wants to merge 6 commits intomasterfrom
adam/19/7/no-federate-for-delete
Closed

[WIP] variant vs. tag vs. config.tag clean-up#1398
zionts wants to merge 6 commits intomasterfrom
adam/19/7/no-federate-for-delete

Conversation

@zionts
Copy link
Copy Markdown
Contributor

@zionts zionts commented Jul 15, 2019

This PR started out trying to do something about service:delete still requiring --federated, but then got super distracted and tried to clean up all of the flags.variant vs. flags.tag nonsense, 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:

  • Update CHANGELOG.md* with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.

Adam Zionts 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.
@zionts zionts changed the title Federation: service:delete should not need the --federated flag [WIP] variant vs. tag vs. config.tag clean-up Jul 15, 2019
@jgzuke jgzuke mentioned this pull request Jul 19, 2019
4 tasks
@zionts
Copy link
Copy Markdown
Contributor Author

zionts commented Dec 18, 2019

Closing this out due to bitrot 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants