ocean icon indicating copy to clipboard operation
ocean copied to clipboard

[Integration][Sonarqube] Fix Date Parsing for SonarQube Analysis Dates

Open emekanwaoma opened this issue 3 days ago • 2 comments

User description

Description

What - Fixed date parsing for lastAnalysisDate and mainBranchLastAnalysisDate fields in SonarQube projects to properly handle timezone offsets and null values.

Why - The previous implementation was not correctly parsing timezone information in date strings and didn't handle null values gracefully, which could cause issues with data processing.

How - Added null coalescing (// null) and regex-based timezone formatting using sub() to convert timezone offsets to the proper +HH:MM format.

Type of change

Please leave one option from the following and delete the rest:

  • [x] Bug fix (non-breaking change which fixes an issue)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • [x] Integration able to create all default resources from scratch
  • [x] Resync finishes successfully
  • [x] Resync able to create entities
  • [x] Resync able to update entities
  • [x] Resync able to detect and delete entities
  • [x] Scheduled resync able to abort existing resync and start a new one
  • [x] Tested with at least 2 integrations from scratch
  • [x] Tested with Kafka and Polling event listeners
  • [x] Tested deletion of entities that don't pass the selector

Integration testing checklist

  • [x] Integration able to create all default resources from scratch
  • [x] Completed a full resync from a freshly installed integration and it completed successfully
  • [x] Resync able to create entities
  • [x] Resync able to update entities
  • [x] Resync able to detect and delete entities
  • [x] Resync finishes successfully
  • [x] If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • [x] If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • [x] If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • [ ] Docs PR link here

Preflight checklist

  • [ ] Handled rate limiting
  • [ ] Handled pagination
  • [ ] Implemented the code in async
  • [ ] Support Multi account

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.


PR Type

Bug fix, Enhancement


Description

  • Fixed date parsing for SonarQube lastAnalysisDate and mainBranchLastAnalysisDate with timezone offset handling and null value support

  • Standardized Azure DevOps blueprint identifiers with azureDevops prefix for consistency

  • Updated Azure DevOps resource mappings to use repository IDs as identifiers instead of composite keys

  • Restructured Azure DevOps board and column blueprint relationships for improved data model clarity


Diagram Walkthrough

flowchart LR
  A["SonarQube Date Fields"] -->|"Add timezone formatting & null handling"| B["Fixed date parsing"]
  C["Azure DevOps Blueprints"] -->|"Add azureDevops prefix"| D["Standardized identifiers"]
  E["Repository Mappings"] -->|"Use ID instead of composite key"| F["Simplified identifiers"]
  G["Board/Column Relations"] -->|"Restructure relationships"| H["Improved data model"]

File Walkthrough

Relevant files
Bug fix
port-app-config.yaml
Fix SonarQube date parsing with timezone handling               

integrations/sonarqube/.port/resources/port-app-config.yaml

  • Fixed lastAnalysisDate field to handle null values and parse timezone
    offsets using regex substitution
  • Fixed mainBranchLastAnalysisDate field with same null-coalescing and
    timezone formatting logic
  • Converts timezone format from +HHMM to +HH:MM for proper ISO 8601
    compliance
+2/-2     
Enhancement
blueprints.json
Standardize Azure DevOps blueprint identifiers                     

integrations/azure-devops/.port/resources/blueprints.json

  • Renamed blueprint identifiers with azureDevops prefix: project →
    azureDevopsProject, service → azureDevopsRepository, workItem →
    azureDevopsWorkItem, release → azureDevopsRelease
  • Swapped board and column blueprint definitions and renamed them to
    azureDevopsBoard and azureDevopsColumn
  • Updated all blueprint relation targets to use new standardized
    identifiers
  • Added link property to azureDevopsBoard blueprint schema
+28/-28 
port-app-config.yaml
Simplify identifiers and update blueprint references         

integrations/azure-devops/.port/resources/port-app-config.yaml

  • Changed repository identifier from composite key (project/repository
    name) to .id for simplicity
  • Updated repository-policy mappings to use .__repository.id instead of
    composite keys
  • Updated all blueprint references to use new standardized names with
    azureDevops prefix
  • Modified work-item identifier to include project ID prefix for
    uniqueness
  • Changed column identifier format from hyphen-separated to
    slash-separated
  • Updated release identifier separator from hyphen to slash for
    consistency
+14/-17 
Documentation
CHANGELOG.md
Document SonarQube date parsing fix                                           

integrations/sonarqube/CHANGELOG.md

  • Added new version 0.1.258 release notes documenting the date parsing
    bug fix
  • Documented fix for timezone offset and null value handling in analysis
    date fields
+8/-0     
Configuration changes
pyproject.toml
Update SonarQube version                                                                 

integrations/sonarqube/pyproject.toml

  • Bumped version from 0.1.257 to 0.1.258 to reflect bug fix release
+1/-1     

emekanwaoma avatar Nov 26 '25 10:11 emekanwaoma