The Media: Power BI module provides a media source and a field formatter plugin that allows you to manage create visualizations within Microsoft Power BI and then embed them within Drupal anywhere Media allows, including fields and WYSIWYG.

Project link

https://www.drupal.org/project/media_power_bi

Comments

minirobot created an issue. See original summary.

vishal.kadam’s picture

Issue summary: View changes

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

avpaderno’s picture

Priority: Normal » Major

I am changing status as per Issue priorities.
To the reviewers: Please set the status back to Normal after a review.

nikral’s picture

Priority: Major » Normal
Status: Needs review » Needs work

Thank you for applying!
I have three suggestions:
- media_power_bi/src/Plugin/Validation/Constraint/MediaPowerBiConstraintValidator.php

  public static function getUrlRegexPattern() {
    return '/^' . preg_quote(self::POWER_BI_DOMAIN, '/') . '|' . preg_quote(self::POWER_BI_GOV_DOMAIN, '/') . '\/view\?r=(\w+)/';
  }

This method is static, but you call it with $this
$pattern = $this->getUrlRegexPattern();
You can also call it with self:: but I don't know what is the best practice

- media_power_bi/src/Form/MediaPowerBiMediaForm.php
$media = $this->createMediaFromValue($media_type, $media_storage, $source_field_name, $url);
As you use declare(strict_types=1);
Can you declare $media to /** @var \Drupal\media\MediaInterface $media */

- media_power_bi/media_power_bi.module hook_theme()
function media_power_bi_theme($existing, $type, $theme, $path)
I think you can remove all unused params $existing, $type, $theme, $path

minirobot’s picture

Thanks for your review @nikral. I've made the suggested changes in the 1.0.x branch.

This method is static, but you call it with $this
$pattern = $this->getUrlRegexPattern();
You can also call it with self:: but I don't know what is the best practice

I used self::getUrlRegexPattern() as you suggested. Since getUrlRegexPattern is a static member self is correct.

nikral’s picture

Status: Needs work » Needs review
trigve hagen’s picture

Status: Needs review » Active

Good clean code, a clear README, Coder returns 0 errors, PARreview looks good.
I just need to test your code out. Is there a way that we could team meet and you can walk through the installation and set up? I do not have a school or business email that I can set up a Microsoft Power BI account with. You might want to record it and put it on YouTube for the next reviewers to see. Then I can mark you as RTBC. Thanks.

vishal.kadam’s picture

Status: Active » Needs review

@Trigve Hagen Comments in this queue are required to review the project files and report what needs to be changed. We do not debug projects.

trigve hagen’s picture

Status: Needs review » Reviewed & tested by the community

Ok. Sounded by RTBC that we tested the code too to make sure it works. So we do not test the code? If that's the case I would set the code to RTBC unless you object. Thanks.

avpaderno’s picture

Assigned: Unassigned » avpaderno

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the Slack #contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the reviewers.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.