Skip to main content

Week 3

(June 17, 2025 – June 23, 2025)

Meeting 1

Date: June 17, 2025
Attendees:

Summary:

  • Presented the ongoing development of a new page under Admin → Text Management, designed to let users manage custom text phrases associated with existing license texts from the license_ref table. This functionality involves a newly created custom_phrase table.
  • Discussed where and how the option to activate the new agent should be made available to users.
  • Mentors brought attention to a pull request submitted by a new contributor related to my project.
  • We discussed strategies for integrating the contributor’s work into the project.
  • Soham recommended that I thoroughly review the PR and document any issues or suggestions related to the submitted code.

Progress:

  • Engaged with mentors to discuss the pull request submitted for my project and shared detailed concerns regarding areas where the implementation was lacking.
  • Attempted to fix the issues within the pull request but encountered challenges in successfully resolving them.
  • Conducted a thorough review of the submitted code to evaluate which parts could be reused or adapted for the project moving forward.

Issues I found in the Pull Request by Aditya

  • Incorrect plugin registeration
    • File: plugin.php
    • Using register method on $textPhrasePlugin which does not exist
    • Solution: Use global register_plugin() function.
  • Missing required class imports
    • TextPhrasePlugin.php
    • Missing imports include:
      • use Fossolohg/Lib/Auth/Auth
      • use Symfony/component/HttpFoundation/Request
    • Solution: Make the necessary imports
  • Missing template file
    • edit.html.twig
    • Solution: create the template file
  • Incorrect Method Parameter Handling
    • TextPhrasePlugin.php
    • handle() method use old-style parameter handling
    • Issue: handle() method should accept Request $request
  • The to be created text_phrases table has to be manually create by the user. But, this should be integreated with the existing FOSSology build process
  • Inconsistent Container Access
    • File: TextPhrasePlugin.php
    • Problem: uneccessary use of $GLOBALS["container"]
    • Solution: should use $this->getObject method which is already present in DefaultPlugin.php
  • Missing template in CMakeList.txt
    • missing upload_options.html.twig and edit.html.twig template in CMakeList.txt
  • Missing AGENT_REV constant definition
    • Files: textphrase_agent.php, TextPhraseDecider.php
    • Both files use AGENT_REV constant but it's not defined anywhere in the textphrase module
    • Solution: Create a version.php file with define("AGENT_REV", "c1d32f"); similar to other agents
  • Missing Auth class import
    • File: TextPhraseDecider.php
    • uses Auth::getUserId() but no import statement for Auth class
    • Solution: Add use Fossology\Lib\Auth\Auth; at the top of the file
  • Inconsistent Container Access in Agent Classes
    • Files: textphrase_agent.php, TextPhraseDecider.php
    • Problem: Direct usage of $GLOBALS['container'] to access services
    • Solution: Should use dependency injection or getter methods from base Agent class
  • Non-existent insertDecision method
    • File: TextPhraseDecider.php
    • Line 125 calls $this->licenseDao->insertDecision($decision) but this method doesn't exist in LicenseDao
    • Solution: Use proper clearing decision API or implement the missing method
  • Missing processUploadId method implementation
    • File: textphrase_agent.php
    • Method processUploadId() exists but should be called by parent Agent class through proper job scheduling
    • Issue: The method is implemented but not integrated with FOSSology's agent scheduling system
  • Missing agent registration in CMakeLists.txt
    • File: CMakeLists.txt
    • Missing proper agent registration for scheduler integration
    • Solution: Add proper agent registration commands for FOSSology build system

After this detailed review of the pull request, I concluded that it would be better to continue the work I have already done on my end.