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

SAAS-28325: Enhance Host Assurance Policy Implementation and Testing & Improve GitHub Actions workflow for Terraform testing #294

Conversation

shani-aqua
Copy link
Collaborator

…Framework

Primary Changes:

  • Implement comprehensive data source acceptance testing framework
  • Restructure resource configuration to align with API specifications
  • Deprecate root-level 'enforce' field in favor of policy_settings.enforce
  • Set 'enabled' field to computed-only to match API behavior

Technical Improvements:

  1. Testing Infrastructure:

    • Add systematic test coverage for data source operations
    • Implement both basic and full configuration test scenarios
    • Add negative test cases for error handling validation
  2. Resource Modifications:

    • Migrate enforcement configuration to policy_settings block
    • Update field computability to prevent state drift
    • Enhance attribute validation logic
  3. Documentation:

    • Add detailed usage examples
    • Update technical specifications
    • Include migration guide for breaking changes
  4. Code Quality:

    • Improve error handling
    • Enhance code organization
    • Standardize testing patterns

Validation:

  • Executed full acceptance test suite
  • Confirmed API response handling
  • Validated state management

Related: SAAS-28325

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Shani Erman seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

…Framework

Primary Changes:
- Implement comprehensive data source acceptance testing framework
- Restructure resource configuration to align with API specifications
- Deprecate root-level 'enforce' field in favor of policy_settings.enforce
- Set 'enabled' field to computed-only to match API behavior

Technical Improvements:
1. Testing Infrastructure:
   - Add systematic test coverage for data source operations
   - Implement both basic and full configuration test scenarios
   - Add negative test cases for error handling validation

2. Resource Modifications:
   - Migrate enforcement configuration to policy_settings block
   - Update field computability to prevent state drift
   - Enhance attribute validation logic

3. Documentation:
   - Add detailed usage examples
   - Update technical specifications
   - Include migration guide for breaking changes

4. Code Quality:
   - Improve error handling
   - Enhance code organization
   - Standardize testing patterns

Validation:
- Executed full acceptance test suite
- Confirmed API response handling
- Validated state management

Related: SAAS-28325
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from bc30f4c to 6a848ce Compare February 9, 2025 12:56
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from 1a4329a to 18802bb Compare February 9, 2025 15:17
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from 18802bb to 1e603c1 Compare February 9, 2025 15:24
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch 2 times, most recently from eec955d to 1949ecb Compare February 9, 2025 15:38
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from cabca52 to e27557f Compare February 10, 2025 11:31
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from e27557f to 6a848ce Compare February 10, 2025 11:44
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from 18a52ef to 8753a92 Compare February 10, 2025 11:49
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from 8753a92 to dc3c98c Compare February 10, 2025 12:02
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from dc3c98c to d875c60 Compare February 10, 2025 12:11
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from d875c60 to 3e1e533 Compare February 10, 2025 12:26
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from 3e1e533 to 156e4b9 Compare February 10, 2025 12:29
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from 156e4b9 to 1e1e893 Compare February 10, 2025 13:19
@shani-aqua shani-aqua changed the title SAAS-28325: Enhance Host Assurance Policy Implementation and Testing … SAAS-28325: Enhance Host Assurance Policy Implementation and Testing & Improve GitHub Actions workflow for Terraform testing Feb 10, 2025
Copy link
Collaborator

Choose a reason for hiding this comment

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

@shani-aqua
Please remove it, i would also consider adding to .gitignore to avoid future commits

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch 2 times, most recently from f42e04c to f501591 Compare February 12, 2025 10:58
Major changes:
- Change from pull_request_target to pull_request to ensure tests run with PR's workflow version
- Update checkout action from v2.3.3 to v4 for better security and performance
- Add max-parallel: 1 to matrix strategy to run Terraform version tests sequentially
- Update Terraform versions to test against:
 - Remove '0.13.7'
 - Add '0.14.11' and '1.5.3'
- Clean up workflow structure and naming for better clarity
 - Rename job from "Matrix Test" to "Test Terraform {version}"
 - Remove redundant comments
 - Consistent formatting throughout the file

These changes ensure tests run sequentially for each Terraform version while
maintaining the ability to easily add/remove versions through the matrix config.
The workflow now runs more reliably and uses the correct version from PR branches.
@shani-aqua shani-aqua force-pushed the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch from f501591 to fda163b Compare February 12, 2025 10:59
@semyonmor semyonmor merged commit 7a3b3f3 into main Feb 16, 2025
6 of 12 checks passed
@semyonmor semyonmor deleted the SAAS-28325-tp-fix-aquasec-host-assurance-policy-resource-and-datasource branch February 16, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants