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

(PE-28373) Use Bolt 2.x #70

Merged
merged 1 commit into from Mar 30, 2020
Merged

(PE-28373) Use Bolt 2.x #70

merged 1 commit into from Mar 30, 2020

Conversation

donoghuc
Copy link
Member

@donoghuc donoghuc commented Mar 26, 2020

Make ACE compatible with Bolt 2.x by updating how we make instantiate inventory/targets and return Results. Specifically every task result should at least have the keys status and value.

@donoghuc donoghuc requested a review from a team March 26, 2020 01:27
'transport' => 'remote'
}
}
target = [Bolt::Target.from_hash(target_data, inventory)]
rescue ACE::Error => e
request_error = {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm wondering if we can just construct Bolt::Results here. https://github.com/puppetlabs/bolt/blob/master/lib/bolt/result.rb#L10 that way we dont have to keep trying to mimic the structure or a proper result.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. Any error here and there will not yet be a Target. See puppetlabs/bolt#1693 for parity w/bolt-server

target = [Bolt::Target.new(body['target']['host'] || body['target']['name'], opts)]
inventory = Bolt::Inventory.empty
target_data = {
'name' => body['target']['host'] || body['target']['name'] || 'remote',
Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like we used to be able to get away with a target with no name???? Not sure what the impact of this will be...

Copy link
Member Author

Choose a reason for hiding this comment

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

This is in my mind the biggest outstanding question.

@donoghuc
Copy link
Member Author

donoghuc commented Mar 26, 2020

Based on #69 for now. Will clean that up once thats merged.

update - done.

@codecov
Copy link

codecov bot commented Mar 26, 2020

Codecov Report

Merging #70 into master will decrease coverage by 0.54%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##            master      #70      +/-   ##
===========================================
- Coverage   100.00%   99.45%   -0.55%     
===========================================
  Files            9        9              
  Lines          369      369              
===========================================
- Hits           369      367       -2     
- Misses           0        2       +2     
Impacted Files Coverage Δ
lib/ace/transport_app.rb 98.59% <100.00%> (-1.41%) ⬇️

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 ea30578...d198cfa. Read the comment docs.

@donoghuc donoghuc force-pushed the bolt-2 branch 2 times, most recently from 3702587 to 52043d2 Compare March 26, 2020 20:50
"object": nil,
"status": "failure",
"result": {
"_error": ACE::Error.to_h(e.message,
Copy link
Member Author

Choose a reason for hiding this comment

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

Lol, not exacly sure what happened here before? But fairly certain that should be .new

@donoghuc donoghuc force-pushed the bolt-2 branch 2 times, most recently from 6ea2da8 to ab4d46f Compare March 27, 2020 14:45
@donoghuc donoghuc changed the title WIP (PE-28373) Use Bolt 2.x Mar 27, 2020
@donoghuc donoghuc requested a review from a team March 27, 2020 14:48
Make ACE compatible with Bolt 2.x by updating how we make instantiate inventory/targets and return Results. Specifically every task result should at least have the keys `status` and `value`.
Copy link
Contributor

@steveax steveax left a comment

Choose a reason for hiding this comment

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

👍

@steveax steveax merged commit 343923e into puppetlabs:master Mar 30, 2020
donoghuc added a commit to donoghuc/ace that referenced this pull request Mar 30, 2020
This commit adds back the acceptance directory removed in puppetlabs#70 as our CI expects there to be such directory.
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.

None yet

2 participants