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

Pin manifest branches to master #173

Merged
merged 25 commits into from
Apr 29, 2020
Merged

Conversation

DylanBaker
Copy link
Collaborator

No description provided.

@DylanBaker DylanBaker requested a review from joshtemple March 29, 2020 16:29
@codecov
Copy link

codecov bot commented Mar 29, 2020

Codecov Report

Merging #173 into master will increase coverage by 0.01%.
The diff coverage is 72.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #173      +/-   ##
==========================================
+ Coverage   70.60%   70.62%   +0.01%     
==========================================
  Files          10       10              
  Lines         820      902      +82     
==========================================
+ Hits          579      637      +58     
- Misses        241      265      +24     
Impacted Files Coverage Δ
spectacles/runner.py 43.18% <37.50%> (-11.37%) ⬇️
spectacles/utils.py 86.04% <50.00%> (-5.85%) ⬇️
spectacles/cli.py 71.05% <60.00%> (-1.61%) ⬇️
spectacles/client.py 78.21% <100.00%> (+6.47%) ⬆️

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 1b58324...7445128. Read the comment docs.

@DylanBaker
Copy link
Collaborator Author

@joshtemple I've rebased this.

I've also temporarily told mypy to ignore the new decorator, because I couldn't figure out a way to solve the following error:

spectacles/runner.py:44: error: Self argument missing for a non-static method (or an invalid type for self)

I'm reasonably certain I am doing something wrong and it's not a mypy issue, but I couldn't figure it out so I'd love your eyes on it.

spectacles/runner.py Outdated Show resolved Hide resolved
spectacles/runner.py Outdated Show resolved Hide resolved
spectacles/runner.py Outdated Show resolved Hide resolved
spectacles/client.py Outdated Show resolved Hide resolved
spectacles/client.py Outdated Show resolved Hide resolved
@@ -388,6 +389,13 @@ def _build_sql_subparser(
user's branch to the revision of the branch that is on the remote. \
WARNING: This will delete any uncommited changes in the user's workspace.",
)
subparser.add_argument(
"--manifest-dependency",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, why can't we do this all the time? Why does it need to be a user-specified behavior?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is because of the 500 bug on the manifest endpoint. If we try to do it and they don't have a manifest file, we get a 500 and won't know if it's actually an internal server error or because they don't have a file. Therefore, for the moment, I'm suggesting that we make them have to call it if they have a manifest file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So I suppose the alternative is to catch the error and have a more descriptive error messaging saying something like "Unexpected error encountered via the Looker API. Please confirm you have a manifest.lkml file in your project. If you do, please submit an issue as described below." Thoughts on the tradeoffs between those approaches?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Most projects won't have a manifest.lkml file. Would you still expect to kill the run when you receive that 500?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah yes, I see now, what I'm suggesting makes no sense. Thoughts on renaming the flag to --multi-project? Or --import-projects? That aligns better with what Looker calls it I think. If I'm looking at the help menu for this I probably have no idea what "manifest dependency" means.

Also, this seems like something you would want to be able to set and forget in the config file or as an environment variable since it's not something you'd be changing run-to-run probably. Can you set it up to work that way as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like --import-projects.

Yeah, makes sense wrt the environment variables. We basically want it's actions to be both EnvVarAction and "store_true". Is there a way to do that in our current setup? Otherwise they would need to pass True to the cli: --import-projects True.

I imagine otherwise we would possible need to write a new class of Action?

@DylanBaker
Copy link
Collaborator Author

@joshtemple Other than exactly where and how the decorator should live, I think this is good for eyes on.

@DylanBaker
Copy link
Collaborator Author

Just tested this out with the team at IndigoAg. For some reason, the branch it was creating was incredibly out of date (9 months old). It seemed not to be pulling the most recent version of master. Going to try to figure out why.

@DylanBaker
Copy link
Collaborator Author

@joshtemple I've changed the --import-projects argument to now have to be passed with TRUE via the CLI. In the current setup, this will allow people to use it with the config and environment variable.

I'd be either happy to push as is, given we think people are rarely going to pass --import-projects via the CLI, or try to find a better way to support the flag in the CLI and still support environment variables.

@DylanBaker DylanBaker merged commit 7c64de9 into master Apr 29, 2020
@DylanBaker DylanBaker deleted the feature/manifest-branches branch April 29, 2020 17:36
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