Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use set environment in commands #150

Merged
merged 18 commits into from
Jun 27, 2019
Merged

fix: Use set environment in commands #150

merged 18 commits into from
Jun 27, 2019

Conversation

jroehl
Copy link

@jroehl jroehl commented Jun 26, 2019

Summary

Fix for #68
Find and add management-token, space-id, environment-id and host to context.

Description

Added middleware function (using yargs middlewares) to build the context by checking if the management-token, space-id, environment-id and host are set in the .contentfulrc.json or passed into the command via flags.

Motivation and Context

This fixes #68 and simplifies checking for cli settings.

Todos

  • Implemented feature
  • Fix tests

@jroehl jroehl added the WIP label Jun 26, 2019
@codecov
Copy link

codecov bot commented Jun 26, 2019

Codecov Report

Merging #150 into master will increase coverage by 0.23%.
The diff coverage is 93.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #150      +/-   ##
==========================================
+ Coverage   82.34%   82.58%   +0.23%     
==========================================
  Files          57       57              
  Lines        1144     1131      -13     
==========================================
- Hits          942      934       -8     
+ Misses        202      197       -5
Impacted Files Coverage Δ
lib/cmds/config_cmds/add.js 84.61% <ø> (+4.61%) ⬆️
lib/context.js 96.77% <ø> (ø) ⬆️
lib/cmds/space_cmds/seed.js 15.38% <0%> (+0.56%) ⬆️
lib/cmds/guide.js 67.64% <0%> (ø) ⬆️
lib/guide/step-seed.js 100% <100%> (ø) ⬆️
lib/cmds/space_cmds/accesstoken_cmds/create.js 95.23% <100%> (ø) ⬆️
lib/cmds/boilerplate.js 95.34% <100%> (+0.11%) ⬆️
lib/utils/assertions.js 100% <100%> (ø) ⬆️
lib/guide/step-login.js 100% <100%> (ø) ⬆️
lib/cmds/space_cmds/import.js 80% <100%> (-4.22%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 075527a...72599d7. Read the comment docs.

@jroehl jroehl removed the WIP label Jun 26, 2019
Copy link
Contributor

@Khaledgarbaya Khaledgarbaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First Round, this looks really great. I have some small comments

lib/cmds/config_cmds/remove.js Outdated Show resolved Hide resolved
lib/utils/middlewares.js Outdated Show resolved Hide resolved
Copy link
Contributor

@phoebeschmidt phoebeschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow so many files changed 👏 looks good!

CI is just timing out on unit tests but looks like everything is passing

lib/cmds/space_cmds/use.js Show resolved Hide resolved
Copy link
Contributor

@Khaledgarbaya Khaledgarbaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 This 👏 is 👏 amazing 👏
One last tiny comment

lib/cmds/extension_cmds/delete.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Khaledgarbaya Khaledgarbaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏
Can you squash and merge? with a commit message like
feat(context): Use middleware to fill context, the feat part will make sure that the ci will increase the version and release a new version

@jroehl jroehl merged commit 3a48664 into master Jun 27, 2019
@jroehl jroehl deleted the fix/use-environment branch June 27, 2019 12:57
@jroehl jroehl added WIP and removed WIP labels Jun 28, 2019
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.

Command "space migration" ignores active environment from .contentfulrc.json
3 participants