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

Add new backend class #277

Merged
merged 37 commits into from
Aug 14, 2020
Merged

Add new backend class #277

merged 37 commits into from
Aug 14, 2020

Conversation

omerdemirok
Copy link
Contributor

@omerdemirok omerdemirok commented Aug 3, 2020

Signed-off-by: Omer Demirok [email protected]

Description

  • Standalone base class (do not require SDK or plug-in)
  • Add generic resources enabling to test any Azure resource
  • Provide server-side filtering via generic resources
  • Support working with different API versions and endpoints
  • Rewrite some of the static resources fully backward compatible

For more info, see project README.

Issues Resolved

Fixes #262, #249, #205

Check List

- Standalone base class (do not require SDK or plug-in)
- Add generic resources enabling to test any Azure resource
- Provide server side filtering via generic resources
- Support working with different api versions and endpoints
- Rewrite some of the static resources fully backward compatible

Signed-off-by: Omer Demirok <[email protected]>
@omerdemirok omerdemirok added the Version: Bump Minor Used by github.minor_bump_labels to bump the Minor version number. label Aug 3, 2020
@omerdemirok omerdemirok requested a review from a team August 3, 2020 14:48
Gemfile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@rmoles rmoles left a comment

Choose a reason for hiding this comment

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

should the .env file be included in this PR?

libraries/azure_backend.rb Outdated Show resolved Hide resolved
Signed-off-by: Omer Demirok <[email protected]>
Signed-off-by: Omer Demirok <[email protected]>
@omerdemirok
Copy link
Contributor Author

omerdemirok commented Aug 4, 2020

should the .env file be included in this PR

Removed it.

libraries/azure_backend.rb Outdated Show resolved Hide resolved
libraries/azure_backend.rb Outdated Show resolved Hide resolved
libraries/azure_backend.rb Outdated Show resolved Hide resolved
Signed-off-by: Omer Demirok <[email protected]>
@omerdemirok
Copy link
Contributor Author

General question: I was attempting to use this branch in my profile with the following depends block in my inspec.yml:

depends:
- name: inspec-azure
  git: https://github.com/inspec/inspec-azure
  branch: azure_generic_resources

But was receiving an error around a require_relative statement:

1: from libraries/azure_backend.rb:1:in 'load_with_context'
libraries/azure_backend.rb:1:in 'require_relative': cannot load such file -- C:/infrastructure_test_profiles/libraries/backend/azure_connection

As you can see, it is looking for the azure_connection file within the folder in which I am executing inspec exec
I realize this may not be the documented way of using this resource pack, but I thought I should mention it in case this is not the intended behavior. Am I doing something wrong using the dependency in this way?

Thanks for this excellent catch, @NathanPrado. Fixing this unearthed some other issues as well.
There are some new dependencies that need to be added to the train plug-in. see
Until then, you can clone this branch and test it locally.
Please check project readme and example inspec.yml.

@NathanPrado
Copy link

NathanPrado commented Aug 10, 2020

Thanks for this excellent catch, @NathanPrado. Fixing this unearthed some other issues as well.
There are some new dependencies that need to be added to the train plug-in. see
Until then, you can clone this branch and test it locally.
Please check project readme and example inspec.yml.

I really appreciate your effort, thank for looking into that. Glad to kill off more bugs. I tried pulling down the latest of this branch locally and referencing it in my tests but got this error now

1: from C:/opscode/inspec/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/opscode/inspec/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- facets/string (LoadError)|

Am I missing a step? Please let me know what I can do to help!

@omerdemirok
Copy link
Contributor Author

omerdemirok commented Aug 11, 2020

Thanks for this excellent catch, @NathanPrado. Fixing this unearthed some other issues as well.
There are some new dependencies that need to be added to the train plug-in. see
Until then, you can clone this branch and test it locally.
Please check project readme and example inspec.yml.

I really appreciate your effort, thank for looking into that. Glad to kill off more bugs. I tried pulling down the latest of this branch locally and referencing it in my tests but got this error now

1: from C:/opscode/inspec/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/opscode/inspec/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- facets/string (LoadError)|

Am I missing a step? Please let me know what I can do to help!

@NathanPrado
Additional gems are removed, and this should work now.
Please see here for testing a new branch in isolation.

Rakefile Outdated Show resolved Hide resolved
@skpaterson skpaterson added the Version: Bump Minor Used by github.minor_bump_labels to bump the Minor version number. label Aug 12, 2020
Copy link

@skpaterson skpaterson left a comment

Choose a reason for hiding this comment

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

This is fantastic work @omerdemirok !!

Copy link
Contributor

@rmoles rmoles left a comment

Choose a reason for hiding this comment

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

Excellent work @omerdemirok! This is a great improvement on the Azure resource pack.

Omer Demirok and others added 2 commits August 14, 2020 11:02
Signed-off-by: Omer Demirok <[email protected]>
Signed-off-by: Ross Moles <[email protected]>
@skpaterson skpaterson merged commit 18b1b3b into master Aug 14, 2020
@skpaterson skpaterson deleted the azure_generic_resources branch August 14, 2020 12:20
@Sum123it
Copy link

@omerdemirok - Can we use azure_generic_resources with this new version? I thought recent inspec versions don't have that.

@omerdemirok
Copy link
Contributor Author

@Sum123it, you should be able to use it if you point the depends to the version v1.20.0.
Replace x with v1.20.0 in this example inspec.yml
https://github.com/inspec/inspec-azure#create-a-new-profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Version: Bump Minor Used by github.minor_bump_labels to bump the Minor version number.
Projects
None yet
5 participants