Skip to content
Snippets Groups Projects

[#12016] Added method into every service as a prototype for fetching specific data

Merged [#12016] Added method into every service as a prototype for fetching specific data
6 unresolved threads
Merged Milan Janoch requested to merge feature/12016 into dev
6 unresolved threads
  • Added first prototype versions of service methods that will fetch specific data
  • Added some basic comments and TODOs to problems I already faced or problems we will need to resolve with Mr. Pícha (e.g. not existing properties or optional properties)

This is just a prototype and this should serve (mainly) to managers @vandl & @JakubHomolka so they can see future structure and how the data is downloaded using the maven library

Merge request reports

Merge request pipeline #13188 passed

Merge request pipeline passed for 69fa8983

Approved by

Merged by Milan JanochMilan Janoch 2 days ago (Mar 13, 2025 3:47pm UTC)

Merge details

  • Changes merged into dev with dcdf49e1 (commits were squashed).
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
172 log.info("------------------------------------");
173 log.info("Issue fetching completed");
174 }
175
176 /**
177 * Formats a DateTime object to a readable string
178 */
179 private String formatDateTime(DateTime dateTime) {
180 return dateTime != null ? dateTime.toString("yyyy-MM-dd HH:mm:ss") : "N/A";
181 }
182
183 /**
184 * Formats bytes to a human-readable size
185 */
186 private String formatBytes(Long bytes) {
187 if (bytes == null) return "Unknown";
  • 171
    172 log.info("------------------------------------");
    173 log.info("Issue fetching completed");
    174 }
    175
    176 /**
    177 * Formats a DateTime object to a readable string
    178 */
    179 private String formatDateTime(DateTime dateTime) {
    180 return dateTime != null ? dateTime.toString("yyyy-MM-dd HH:mm:ss") : "N/A";
    181 }
    182
    183 /**
    184 * Formats bytes to a human-readable size
    185 */
    186 private String formatBytes(Long bytes) {
  • 48 log.info("Issue ID: {}", issue.getId());
    49 log.info("Key: {}", issue.getKey());
    50 log.info("Summary: {}", issue.getSummary());
    51
    52 if (issue.getDescription() != null) {
    53 String desc = issue.getDescription();
    54 // Truncate long descriptions for logging
    55 if (desc.length() > 100) {
    56 desc = desc.substring(0, 97) + "...";
    57 }
    58 log.info("Description: {}", desc);
    59 }
    60
    61 // Custom Fields
    62 for (IssueField field : issue.getFields()) {
    63 if (field.getName() != null && field.getName().equalsIgnoreCase("severity") && field.getValue() != null) {
  • 100 if (description != null) {
    101 log.info(" Description: {}", description);
    102 }
    103 } catch (Exception e) {
    104 // Description method not available
    105 }
    106
    107 // Try to get lead using reflection
    108 try {
    109 Object lead = component.getClass().getMethod("getLead").invoke(component);
    110 if (lead != null) {
    111 Object displayName = lead.getClass().getMethod("getDisplayName").invoke(lead);
    112 Object name = lead.getClass().getMethod("getName").invoke(lead);
    113 log.info(" Lead: {} ({})", displayName, name);
    114 }
    115 } catch (Exception e) {
  • 88 try {
    89 Object id = component.getClass().getMethod("getId").invoke(component);
    90 if (id != null) {
    91 log.info(" ID: {}", id);
    92 }
    93 } catch (Exception e) {
    94 // ID method not available
    95 }
    96
    97 // Try to get description using reflection
    98 try {
    99 Object description = component.getClass().getMethod("getDescription").invoke(component);
    100 if (description != null) {
    101 log.info(" Description: {}", description);
    102 }
    103 } catch (Exception e) {
  • 78 }
    79 }
    80
    81 // Log components
    82 log.info("Components:");
    83 if (project.getComponents().iterator().hasNext()) {
    84 for (BasicComponent component : project.getComponents()) {
    85 log.info(" Component Name: {}", component.getName());
    86
    87 // Try to get ID using reflection since API implementations may vary
    88 try {
    89 Object id = component.getClass().getMethod("getId").invoke(component);
    90 if (id != null) {
    91 log.info(" ID: {}", id);
    92 }
    93 } catch (Exception e) {
  • Static Analysis Summary

    Download full detail reports

    PMD Overview Report

    Total Violations: 25

    High Severity
    Medium Severity
    Low Severity

    SpotBugs Overview Report

    Total Bugs: 8

    High Severity
    Medium Severity
    Low Severity

  • Jakub Pavlíček approved this merge request

    approved this merge request

  • Milan Janoch mentioned in commit dcdf49e1

    mentioned in commit dcdf49e1

  • merged

  • Please register or sign in to reply
    Loading