Skip to content

Newrelic api change #32648

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

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

nuzil
Copy link
Contributor

@nuzil nuzil commented Apr 1, 2021

Description (*)

New Relic has an possibility to setup deployment markers.
But this feature is not working anymore, cause NewRelic changed API some time ago and current implementation is useless.

I changed Modue to work with a new API.

More info:
https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/record-monitor-deployments/

Fixed Issues (if relevant)

Fixed Deployment functionality for NewRelic module

Manual testing scenarios (*)

  1. Deployment marker can be sent manually from CMD: bin/magento newrelic:create:deploy-marker "Name" "Description" "Email", "Release"
  2. Every time Cache flushed, marker is set

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Newrelic api change #32649: Newrelic api change

@m2-assistant
Copy link

m2-assistant bot commented Apr 1, 2021

Hi @nuzil. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@nuzil
Copy link
Contributor Author

nuzil commented Apr 1, 2021

@magento run all tests

@nuzil
Copy link
Contributor Author

nuzil commented Apr 1, 2021

@magento create issue

@mrtuvn
Copy link
Contributor

mrtuvn commented Apr 2, 2021

@magento run Functional Tests B2B, Functional Tests EE, WebAPI Tests

@mrtuvn
Copy link
Contributor

mrtuvn commented Apr 5, 2021

@magento run WebAPI Tests

@@ -15,7 +15,7 @@ class Deployments
/**
* API URL for New Relic deployments
*/
const API_URL = 'https://api.newrelic.com/deployments.xml';
const API_URL = 'https://api.newrelic.com/v2/applications/%s/deployments.json';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we take value from config (app/code/Magento/NewRelicReporting/etc/config.xml) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @swnsma
We do,

$apiUrl = $this->config->getNewRelicApiUrl();
        if (empty($apiUrl)) {
            $this->logger->notice('New Relic API URL is blank, using fallback URL');
            $apiUrl = self::API_URL;
        }

I see that config.xml is exists in module and cannot be empty in this case, but also may happen that somebody already extended module and for some reason using constant. So I would leave it there

@gabrieldagama gabrieldagama added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Apr 8, 2021
@swnsma swnsma self-requested a review April 12, 2021 14:21
@magento-engcom-team
Copy link
Contributor

Hi @swnsma, thank you for the review.
ENGCOM-8998 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented Sep 15, 2021

Hi @nuzil
Thanks for your contribution and collaboration.

Flushed after I hit the command php bin/magento newrelic:create:deploy-marker "manju1_deply1" "System.log".
The log file is not having the information about marker being set. can you please how you are validating the marker being
Thanks in advance

@engcom-Alfa
Copy link
Contributor

Hi @nuzil
Thanks for your contribution and collaboration.

I am flushed after I hit the command php bin/magento newrelic:create:deploy-marker "manju1_deply1" "System.log".
The log file is not having the information about marker being set. can you please how you are validating the marker being
Thanks in advance

Ok, Seems I have to do some missing configurations, will come back soon! thanks!

@engcom-Alfa
Copy link
Contributor

Hi @nuzil
Thanks for your contribution and collaboration on this, I am able to proceed ahead after slack discussion with you. Thanks for all the help :)

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Preconditions:

  1. Have Magento latest instance installed
  2. Should have a new relic account and with valid license and should have integrated to Magento instance

Manual testing scenario:

  1. Make sure Admin>Store>Configurations>General>New Relic Reporting has been updated with all the required information.

  2. Execute the below command and validate the new relic deployment gets successful.
    bin/magento newrelic:create:deploy-marker "name" "Description" "Email" "Release"

Before: ✖️ Were not able to deploy successfully

image

After: ✔️ Able to deploy successfully (below screenshot has the successfully deployed log too)

image

Since this fix is relevant to the latest release version of new relic and its integration, it has no impact on any other functionalities. Hence no additional regression is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: advanced Award: bug fix Award: test coverage Component: NewRelicReporting Partner: Comwrap partners-contribution Pull Request is created by Magento Partner Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Newrelic api change
7 participants