Bug 1516458 - take rootURL as config and set TASKCLUSTER_ROOT_URL and TASKCLUSTER_PROXY_URL#135
Conversation
557de62 to
851aded
Compare
|
hm, well, this isn't working yet.. |
|
(somehow the tests passed for me locally once, but not anymore) |
|
OK, I think I figured it out -- // generate commands, in case features want to modify them
for i := range task.Payload.Command {
err := task.generateCommand(i) // platform specific
if err != nil {
panic(err)
}
} This fixes the tests for me locally. The error in CI on Windows is which confuses me -- the PR makes the following change to the URL: so both before and (from the logging) after, it's |
|
The Travis build is failing because env vars aren't available to PRs |
0e61869 to
edf05e1
Compare
|
The same TestTaskclusterProxy test that's failing here seems to be failing reliably on master, just differently: https://taskcluster-artifacts.net/flKO8uO0T3yA5rfyfQe2fg/0/public/logs/live_backing.log (note when looking at those logs, there are two different test cases named TestTaskclusterProxy) ..so perhaps this has never worked, and my patch is unrelated? |
It looks like it may be related to your patch. See |
|
I suspect changes to the taskcluster proxy test(s) will be needed in light of taskcluster/taskcluster-proxy#38 |
|
Although the comments in that PR say "This should be 100% backward compatible" so I'm not sure. Looking deeper now... |
|
This PR contains the fixes to make generic-worker work with the latest tc-proxy (after So we're back to localhost not resolving on windows. Googling suggests that's because %SYSROOT% isn't set, and from the look of the logs, it is not set: https://taskcluster-artifacts.net/NIlDOfEvR5msuvQlCi03gw/0/public/logs/live_backing.log |
This has a few advantages: * permits adding the queue:create-artifact:.. scope * avoides an unnecessary additional call to queue.task(..) by the proxy * duplicates docker-worker's approach to minimize chance of behavior change
|
So, I think the options are:
@petemoore which do you prefer? |
This was slightly off-base: I added some debugging to catch the case where the process environment is required and accessToken is nil, but that doesn't catch this particular error. So, I think editing
I'm leaning toward the second one. |
fbf6cb7 to
30ab2b1
Compare
|
It's green! |
d07d20b to
07c912c
Compare
|
OK, that's all green except for coveralls. I don't know why it thinks coveraged dropped 52.9% - that's obviously wrong! |
petemoore
left a comment
There was a problem hiding this comment.
Last change request, and then we're done!
You can ignore the nit - the other change request is some straggling code that I think you accidentally left in when you added and then removed some debugging statements...
|
|
||
| // Set an environment variable in each command. This can be called from a feature's | ||
| // NewTaskFeature method to set variables for the task. | ||
| func (task *TaskRun) setVariable(variable string, value string) error { |
There was a problem hiding this comment.
This is just a nit, not a required change.
Nit: I would have probably called this setEnvironmentVariable for clarity, and made it a function of the environment rather than the task, but it doesn't really matter. This avoids the duplication of the loop over the task commands in both platform implementations. If you provide a method that just updates an environment block in a platform-independent way, you can have a single loop over the task commands, that is platform independent. It doesn't really matter though.
Note, originally the windows and all-unix-style process implementations were quite different, but with go 1.10 it became possible to use the standard library for running processes as a different user under windows, at which point it became possible to have very similar implementations for both. I intend to clean up some of the duplication in a future PR, and at that point will probably introduce a separate go type for an environment block (something like type Environment []string) that will have its own func (env *Environment) Set(envVar string, value string), func (env *Environment) Clear(envVar string) functions for modifying it. So it makes sense to rework this at the same time, so we can leave it as is for now.
There was a problem hiding this comment.
I'll leave that to you :)
* factor out and test non-platform-specific MergeEnvLists * handle the task-user and current-user modes differently
With this change, the proxy knows the rootUrl, and the task has a reliable indication of the proxy URL There is no provision for a feature to set a task environment variable, and in fact features are not even initialized yet when the task commands are created, so this special-cases the TaskclusterProxyFeature for inclusion in the task environment.
petemoore
left a comment
There was a problem hiding this comment.
Many thanks Dustin!
Dustin determined that the code coverage drop is simply due to the PR coming from a forked repo, and that we disabled access to production taskcluster for integration tests from forked repos. When this lands on master, we can check the code coverage report there.
…erty names in bulk property activities
|
Coverage looks good on master. Note that Travis doesn't support using env vars on PRs! |
For tests, we just run `go get github.com/taskcluster/taskcluster-proxy, so this uses the newest version. I'm not sure how to accomplish that in the prod deployment.