-
Notifications
You must be signed in to change notification settings - Fork 399
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
[feature] tasks #196
[feature] tasks #196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I forgot on the previous review - can you add an acceptance test for this resource? Ideally one that exercises some of the update logic.
@henriblancke it appears there is another PR covering this -> #198 Can you all work together on this? |
@henriblancke @ryanking Happy to collaborate here the core of our 2 MRs seems very similar minus a few cosmetic differences. The biggest difference seems to be in mine I handle temporarily suspending the root task of a tree so that the child tasks can be altered and then resume it after the fact. From the docs:
Another difference is that in my PR i directly expose the state (Suspended|Started) via an enabled flag. Anyways let me know how I can Help. |
@chriskuchin yeah your handling of task dependencies seems much better. Having the option to enable/disable the task is also nice! One thing I noticed tho is that you're not exposing |
Yeah I got distracted and forgot about them. Happy to put a little more time into the PR if that's what we wanna do and add that |
Perhaps we can move forward by merging @chriskuchin's PR then adding session_params as a separate PR? |
I nearly have the session_parameters piece done on my PR just testing and debugging now @ryanking |
@ryanking @chriskuchin I actually went ahead and added the |
@henriblancke sounds good. Have you tested you session parameters? I had to modify them pretty heavily for them to actually work. Plus you weren't reading their state at all. |
@chriskuchin it did test em, but maybe not enough 😄? Can you elaborate? What do you mean by not reading state? Thanks! |
You never read at least that I could find the parameters after you set them. The other problem I had was you were escaping the parameter values which caused them to be invalid as well as not wrapping them in quotes |
They aren't even running they error out about not being configured in Travis. Are they passing for you locally? |
Ahh you have the acceptance tests hooked up to your fork... I have no idea that was never an error I saw when writing them or getting things working. Sounds like it's an error in the first step. You can enable tf_logs=debug to get more info but it's really noisy so might be hard. Can you run it locally so you run just that test with debug? |
So it seems to have something to do with your state. The error occurs during a state refresh so it's probably in the read function I would guess |
@chriskuchin yeah just figured it out adding the id we get from snowflake during reading the task caused the error. It breaks |
ahh that makes sense I didn't follow that compound id pattern in My MR 👍 let me know if i can help |
ok i will take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quite good, most of my comments here are matters of style.
pkg/resources/task.go
Outdated
for { | ||
|
||
builder := snowflake.Task(name, database, dbSchema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for { | |
builder := snowflake.Task(name, database, dbSchema) | |
for { | |
builder := snowflake.Task(name, database, dbSchema) |
row := snowflake.QueryRow(db, q) | ||
task, err := snowflake.ScanTask(row) | ||
|
||
if err != nil && name != data.Get("name").(string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conditional is not very clear. Why do we ignore errors when name == data.Get("name")?
Snowflake appears to have changed something which is now causing this test to fail. Skipping it for now while I find someone who can address the problem. cc @henriblancke and @chriskuchin who worked on this originally. Any chance one of you could look at this? ## Test Plan * [ ] acceptance tests ## References * #196
Attempt to add task support.
Couple of notes:
after
only supports tasks that are in the same schema (as per the docs)Travis build