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

chore: forest-archive dns migration to forest-internal #453

Merged
merged 4 commits into from
Jun 24, 2024

Conversation

samuelarogbonlo
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • forest-archive DNS migration to forest-internal

Reference issue to close (if applicable)

Closes

Other information and links

@samuelarogbonlo samuelarogbonlo marked this pull request as ready for review June 21, 2024 11:25
@samuelarogbonlo samuelarogbonlo requested a review from a team as a code owner June 21, 2024 11:25
@samuelarogbonlo samuelarogbonlo requested review from hanabi1224 and elmattic and removed request for a team June 21, 2024 11:25
Copy link

github-actions bot commented Jun 21, 2024

Forest: Snapshot Service Infrastructure Plan: success

Show Plan
newrelic_notification_channel.slack-channel[0]: Refreshing state... [id=2b6082f7-06e3-4947-b2bd-5ae0691038b6]
newrelic_alert_policy.alert: Refreshing state... [id=1319060]
newrelic_synthetics_script_monitor.snapshot-age-monitor: Refreshing state... [id=Mzk0MjU3NXxTWU5USHxNT05JVE9SfGNlNjIyNmVhLWQ0MGEtNDE2OS1hNWQ2LWNjYjBiZTk4OTdhNA]
newrelic_notification_channel.pagerduty-channel[0]: Refreshing state... [id=6f147e42-38c3-4eef-9246-00c4dfd68da7]
newrelic_nrql_alert_condition.failing-snapshot-age: Refreshing state... [id=1319060:5975451]
newrelic_workflow.alerting-workflow-slack[0]: Refreshing state... [id=81a87711-6a9b-41c6-b35a-8fc073c82832]
newrelic_workflow.alerting-workflow-pagerduty[0]: Refreshing state... [id=b19c03a4-3b85-4bec-9bb5-3b23b9c77c7c]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # newrelic_synthetics_script_monitor.snapshot-age-monitor will be updated in-place
  ~ resource "newrelic_synthetics_script_monitor" "snapshot-age-monitor" {
        id                   = "Mzk0MjU3NXxTWU5USHxNT05JVE9SfGNlNjIyNmVhLWQ0MGEtNDE2OS1hNWQ2LWNjYjBiZTk4OTdhNA"
        name                 = "prod-snapshot-age-monitor"
      ~ script               = <<-EOT
            // eslint-disable-next-line @typescript-eslint/no-var-requires -- "approved" methods of resolving this lint do not work in the NR context.
            var assert = require("assert");
            
            function check_snapshot(url, genesisTime) {
              // eslint-disable-next-line @typescript-eslint/no-unused-vars -- that's how the callback works in this context.
              var callback = function (_err, response, _body) {
                assert.equal(response.statusCode, 200, "Expected a 200 OK response");
            
                var snapshotName = response.url.split("/").pop();
                var height = snapshotName.match(/height_(\d+)/)[1];
            
                var currentTime = Math.floor(Date.now() / 1000);
                var snapshotTime = height * 30 + genesisTime;
                var snapshotAgeInMinutes = (currentTime - snapshotTime) / 60;
            
                assert(
                  snapshotAgeInMinutes < 360,
                  "Expected snapshot to be less than 360 minutes old"
                );
              };
            
              // This variable is provided by New Relic.
              // eslint-disable-next-line no-undef
              $http.head(url, callback);
            }
            
            check_snapshot(
          -   "https://forest-archive.chainsafe.dev/latest/calibnet/",
          +   "https://forest-internal.chainsafe.dev/latest/calibnet/",
              1667326380
            );
            check_snapshot(
          -   "https://forest-archive.chainsafe.dev/latest/mainnet/",
          +   "https://forest-internal.chainsafe.dev/latest/mainnet/",
              1598306400
            );
        EOT
        # (10 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: /home/runner/work/forest-iac/forest-iac/tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "/home/runner/work/forest-iac/forest-iac/tfplan"

Signed-off-by: samuelarogbonlo <[email protected]>
Signed-off-by: samuelarogbonlo <[email protected]>
@LesnyRumcajs
Copy link
Member

Any reason you omitted these?

images/snapshot-service/src/upload_snapshot.sh|71 col 40| for i in {1..5}; do aria2c -x5 https://forest-archive.chainsafe.dev/latest/$CHAIN_NAME/ && break || sleep 15; done
tf-managed/modules/snapshot-monitoring/README.md|4 col 12| - <https://forest-archive.chainsafe.dev/mainnet/latest/>
tf-managed/modules/snapshot-monitoring/README.md|5 col 12| - <https://forest-archive.chainsafe.dev/calibnet/latest/>

@hanabi1224
Copy link
Contributor

LGTM. Just one nit, from a normal user's perspective, internal in the URL is a bit surprising and makes me double check if it's the proper link, public look more proper to me

@LesnyRumcajs
Copy link
Member

LGTM. Just one nit, from a normal user's perspective, internal in the URL is a bit surprising and makes me double check if it's the proper link, public look more proper to me

To my understanding, the entire internal (and so quite a bit of code in this repository) will soon go, and before that, it shouldn't be used outside of the Forest team.

Signed-off-by: samuelarogbonlo <[email protected]>
@samuelarogbonlo
Copy link
Contributor Author

samuelarogbonlo commented Jun 24, 2024

Any reason you omitted these?

images/snapshot-service/src/upload_snapshot.sh|71 col 40| for i in {1..5}; do aria2c -x5 https://forest-archive.chainsafe.dev/latest/$CHAIN_NAME/ && break || sleep 15; done
tf-managed/modules/snapshot-monitoring/README.md|4 col 12| - <https://forest-archive.chainsafe.dev/mainnet/latest/>
tf-managed/modules/snapshot-monitoring/README.md|5 col 12| - <https://forest-archive.chainsafe.dev/calibnet/latest/>

@LesnyRumcajs None just missed them.

@samuelarogbonlo samuelarogbonlo merged commit d427c92 into main Jun 24, 2024
13 checks passed
@samuelarogbonlo samuelarogbonlo deleted the samuel/migrate-cf-dns branch June 24, 2024 11:32
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.

3 participants