Fix credentials fetching during publishing

Review Request #901 - Created Aug. 15, 2014 and submitted

Information
Andy Reitz
pants
Reviewers
pants-reviews
stuhood, tejal, travis
resolve(auth) returns a set now
Without this change, I see this error:

Exception caught:
  File "/Users/areitz/Library/Application Support/IntelliJIdea13/python/helpers/pydev/pydevd.py", line 1534, in <module>
    debugger.run(setup['file'], None, None)
  File "/Users/areitz/Library/Application Support/IntelliJIdea13/python/helpers/pydev/pydevd.py", line 1145, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/bin/pants_exe.py", line 201, in <module>
    main()
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/bin/pants_exe.py", line 196, in main
    _run()
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/bin/pants_exe.py", line 177, in _run
    result = command.run(lock)
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/commands/goal.py", line 297, in run
    return engine.execute(context, self.phases)
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/engine/engine.py", line 50, in execute
    self.attempt(context, phases)
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/engine/round_engine.py", line 170, in attempt
    phase_executors = list(self._prepare(context, phases))
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/engine/round_engine.py", line 164, in _prepare
    self._visit_phase(phase, context, phase_info_by_phase)
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/engine/round_engine.py", line 120, in _visit_phase
    task = task_type(context, task_workdir)
  File "/Users/areitz/.pants.dev/os_pants/src/python/pants/backend/jvm/tasks/jar_publish.py", line 388, in __init__
    credentials = context.resolve(auth).next()

Exception message: 'set' object has no attribute 'next'


With this change, I see a valid credentials object (in the debugger).

Issues

  • 3
  • 1
  • 0
  • 4
Description From Last Updated
context.resolve or anything involving the BuildGraph should not be called in SubTask.__init__. Delay to execute() and maybe pull it into ... Patrick Lawson Patrick Lawson
I see there is a test_jar_publish.py, no corresponding changes (or new test case addition) over there? Jin Feng Jin Feng
context isn't defined here. During a real publish this fails. I think this definitely calls for an integration test. Patrick Lawson Patrick Lawson
Stu Hood
Andy Reitz
Stu Hood
Patrick Lawson
Jin Feng
Andy Reitz
Review request changed

Status: Closed (submitted)

Patrick Lawson

   

context isn't defined here. During a real publish this fails.

I think this definitely calls for an integration test.

  1. I repro, this was sloppy on my part: https://rbcommons.com/s/twitter/r/940/

    I agree with the tests, I think that Jin Feng is looking into that.

Loading...