<https://github.com/pantsbuild/pants/blob/c0e4ae92...
# general
b
I think
pants confluence
cannot find a page now
h
Yes the code is correct. In python, methods start with
self
as their first parameter. When you call something like my_instance.method(), self will be automatically passed What is the issue you’re running into?
b
oh… thanks. I did
./pants confluence docs:doctest
with this BUILD (space was our company name)
Copy code
page(name="docktest",
     source="doctest.md",
     provides=[
         wiki_artifact(wiki=confluence,
                       space='****',
                       title='doctest',
                       )
     ],
)
and it returns
Copy code
Published Page(BuildFileAddress(docs/BUILD, doctest)) to <https://confluence>.******.com/confluence/display/*****/doctest
10:22:54 00:04   [complete]
               SUCCESS
but if I do again, it returns
Copy code
timestamp: 2020-02-07T10:24:21.811116
Exception caught: (builtins.TypeError)
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/bin/pants", line 8, in <module>
    sys.exit(main())
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/pants_loader.py", line 78, in main
    PantsLoader.run()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/pants_loader.py", line 74, in run
    cls.load_and_execute(entrypoint)
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/pants_loader.py", line 67, in load_and_execute
    entrypoint_main()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/pants_exe.py", line 32, in main
    PantsRunner(start_time=start_time).run()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/pants_runner.py", line 99, in run
    return runner.run()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 240, in run
    self._run()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 309, in _run
    goal_runner_result = self._maybe_run_v1()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 268, in _maybe_run_v1
    return goal_runner_factory.create().run()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/goal_runner.py", line 205, in run
    return self._run_goals()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/goal_runner.py", line 176, in _run_goals
    result = self._execute_engine()
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/bin/goal_runner.py", line 164, in _execute_engine
    result = engine.execute(self._context, self._goals)
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/engine/legacy_engine.py", line 21, in execute
    self.attempt(context, goals)
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/engine/round_engine.py", line 229, in attempt
    goal_executor.attempt(explain)
  File "/Users/****/.cache/pants/setup/bootstrap-Darwin-x86_64/1.22.0_py38/lib/python3.8/site-packages/pants/engine/round_engine.py", line 45, in attempt
    task.execute()
  File "/Users/****/.cache/pants/plugins/pantsbuild.pants.contrib.confluence-1.22.0-py36.py37-none-any.whl-install/pants/contrib/confluence/tasks/confluence_publish.py", line 78, in execute
    url = self.publish_page(
  File "/Users/****/.cache/pants/plugins/pantsbuild.pants.contrib.confluence-1.22.0-py36.py37-none-any.whl-install/pants/contrib/confluence/tasks/confluence_publish.py", line 119, in publish_page
    return page['url']

Exception message: 'NoneType' object is not subscriptable
and also if BUILD target has a parent like
Copy code
page(name="doctest",
     source="doctest.md",
     provides=[
         wiki_artifact(wiki=confluence,
                       space='****',
                       title='doctest',
                       parent='FOO BAR',
                       )
     ],
)
(FOO BAR was the existing page name) it returns
Copy code
FAILURE: Failed to update confluence: Failed to find parent page FOO BAR in space ****
so I guess there is some issue in getpage function.
Copy code
[GLOBAL]
pants_version : 1.22.0
Copy code
% python --version                                                                                                                                                 
Python 3.8.0
Copy code
plugins : [          'pantsbuild.pants.contrib.confluence==%(pants_version)s',
          ]
Does anyone have the same issue?
h
hmm, let's see if we can repro
b
thank you…
h
I don't repro this right now
If there's an error storing the page we log it and return None, which is probably not great
Do you see that "Failed to store page" error?
In your output?
I don't know much about this plugin. Someone at Twitter might. @gorgeous-alligator-94763, if you're still involved?
g
I only moved the confluence code into the plugin, I never touched any of that code. I’m also no longer involved really. Sorry!