diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index c63993f8378..e88ab00e39c 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -24,9 +24,8 @@ on: env: REGISTRY: ghcr.io REPO: ghcr.io/datadog/dd-trace-rb - # Broken system-test: https://github.com/DataDog/system-tests/pull/3904 - SYSTEM_TESTS_REF: 239c3eba6de0473817d3d88ebbc025c9d0c9574b - # SYSTEM_TESTS_REF: main # This must always be set to `main` on dd-trace-rb's master branch + # TODO: remove this change before merging to master + SYSTEM_TESTS_REF: enable-ip-blocking-for-ruby jobs: build-harness: diff --git a/lib/datadog/appsec/remote.rb b/lib/datadog/appsec/remote.rb index 163ebac352b..d697a60c65a 100644 --- a/lib/datadog/appsec/remote.rb +++ b/lib/datadog/appsec/remote.rb @@ -104,6 +104,10 @@ def receivers(telemetry) ) Datadog::AppSec.reconfigure(ruleset: ruleset, telemetry: telemetry) + + repository.contents.each do |content| + content.applied if ASM_PRODUCTS.include?(content.path.product) + end end [receiver] diff --git a/spec/datadog/appsec/remote_spec.rb b/spec/datadog/appsec/remote_spec.rb index 4b1db36be98..cd93263682a 100644 --- a/spec/datadog/appsec/remote_spec.rb +++ b/spec/datadog/appsec/remote_spec.rb @@ -173,6 +173,12 @@ receiver.call(repository, changes) end + it 'sets apply_state to ACKNOWLEDGED on content' do + receiver.call(repository, transaction) + + expect(content.apply_state).to eq(Datadog::Core::Remote::Configuration::Content::ApplyState::ACKNOWLEDGED) + end + context 'content product' do before do # Stub the reconfigure method, so we do not trigger background reconfiguration @@ -290,6 +296,13 @@ context 'ASM' do let(:path) { 'datadog/603646/ASM/whatevername/config' } + let(:data) { {} } + + it 'sets apply_state to ACKNOWLEDGED on content' do + receiver.call(repository, transaction) + + expect(content.apply_state).to eq(Datadog::Core::Remote::Configuration::Content::ApplyState::ACKNOWLEDGED) + end context 'overrides' do let(:data) do @@ -405,6 +418,13 @@ context 'ASM_DATA' do let(:path) { 'datadog/603646/ASM_DATA/whatevername/config' } + let(:data) { {} } + + it 'sets apply_state to ACKNOWLEDGED on content' do + receiver.call(repository, transaction) + + expect(content.apply_state).to eq(Datadog::Core::Remote::Configuration::Content::ApplyState::ACKNOWLEDGED) + end context 'with rules_data information' do let(:data) do