Skip to content

mirror doc changes from recog-ruby#547

Merged
mkienow-r7 merged 6 commits intorapid7:mainfrom
TomSellers:docs_temp_params
Mar 17, 2023
Merged

mirror doc changes from recog-ruby#547
mkienow-r7 merged 6 commits intorapid7:mainfrom
TomSellers:docs_temp_params

Conversation

@TomSellers
Copy link
Copy Markdown
Contributor

@TomSellers TomSellers commented Feb 23, 2023

Description

This PR mirrors README changes from rapid7/recog-ruby#12
Please see that PR for discussion.

it also prevents the _tmp. attributes from being added to the identifiers/fields.txt file.

NOTE: Tests involving features/data/successful_tests.xml and the recog-ruby implementation SHOULD fail until that PR is landed.

<param pos="1" name="os.version" />
<param pos="0" name="os.name" value="Bar" />
</fingerprint>
<fingerprint pattern="^foo sb\-([\d.]+)$">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From my testing features/verify.feature fails and needs to be updated since this adds a 5th example and changes the output message.

  Scenario: Successful tests                       # features/verify.feature:11
    When I run `recog_verify successful_tests.xml` # aruba-2.1.0/lib/aruba/cucumber/command.rb:3
    Then it should pass with exactly:              # aruba-2.1.0/lib/aruba/cucumber/command.rb:404
      """
      successful_tests.xml: SUMMARY: Test completed with 4 successful, 0 warnings, and 0 failures
      """
      expected `recog_verify successful_tests.xml` to have output output string is eq: "successful_tests.xml: SUMMARY: Test completed with 4 successful, 0 warnings, and 0 failures"
      but was:
         successful_tests.xml: SUMMARY: Test completed with 5 successful, 0 warnings, and 0 failures
      Diff:
      @@ -1 +1 @@
      -(output string is eq: "successful_tests.xml: SUMMARY: Test completed with 4 successful, 0 warnings, and 0 failures")
      +"successful_tests.xml: SUMMARY: Test completed with 5 successful, 0 warnings, and 0 failures"
       (RSpec::Expectations::ExpectationNotMetError)
      features/verify.feature:13:in `it should pass with exactly:'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed, thanks. After this morning's push the only errors there are due to the changes made in recog-ruby

  @no-clobber
  Scenario: Successful tests                       # features/verify.feature:11
    When I run `recog_verify successful_tests.xml` # aruba-2.1.0/lib/aruba/cucumber/command.rb:3
    Then it should pass with exactly:              # aruba-2.1.0/lib/aruba/cucumber/command.rb:404
      """
      successful_tests.xml: SUMMARY: Test completed with 5 successful, 0 warnings, and 0 failures
      """
      Expected `recog_verify successful_tests.xml` to succeed but got non-zero exit status and the following output:
      
      successful_tests.xml:18: FAIL: 'test of temp params' is missing an example that checks for parameter '_tmp.001' which is derived from a capture group
      successful_tests.xml: SUMMARY: Test completed with 5 successful, 0 warnings, and 1 failures
      
       (RSpec::Expectations::ExpectationNotMetError)
      features/verify.feature:13:in `it should pass with exactly:'

Comment thread bin/recog_standardize
Comment thread Gemfile Outdated
gemspec name: 'recog-content'

gem 'recog', '~>3.0'
gem 'recog', '~>3.0.5'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

By default the next build would be 3.0.4 rather than 3.0.5 (see recog-ruby 99e3690).

The intention behind using ~>3.0 was to allow it to track more versions before requiring another Gemfile update (see comment).

~>3.0 matches the latest version from the 3.x series, for example, this would match everything from 3.*.*, but not the next major level release 4.0.0. By specifying the patch level ~>3.0.5, that is equivalent to ['>= 3.0.5', '< 3.1.0'] and will require more frequent Gemfile updates.

In this situation, following Semantic Versioning we should increment the MINOR version during the release process. Note, that I'm viewing this from the standpoint of not breaking the API interface.

MINOR version when you add functionality in a backwards compatible manner

Therefore, this should should be set to ~>3.1 and the next release will be for version 3.1.0. This will allow the version to float upward as before, except now from 3.1 to 4.0 (exclusive) (see Preventing Version Catastrophe).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch, sorry about that.

Comment thread README.md Outdated
There is special handling for temporary attributes that have a name starting with
`_tmp.`. These attributes can be used for interpolation but are not emitted in the
output. This is useful when a particular product name is inconsistent in various
banners, vendor marketing, or with NIST values when trying to generated CPEs. In
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/generated/generate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks.

Copy link
Copy Markdown
Contributor

@mkienow-r7 mkienow-r7 left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @TomSellers!

@mkienow-r7 mkienow-r7 merged commit bbb61f1 into rapid7:main Mar 17, 2023
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.

2 participants