Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Manual SonarCloud Analysis

on:
workflow_dispatch:
inputs:
pr_id:
description: 'Pull Request ID to analyze'
required: true
type: string

jobs:
sonar-analysis:
name: SonarCloud Analysis for PR
runs-on: ubuntu-latest

steps:
- name: Get PR details
id: pr
uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: ${{ inputs.pr_id }}
});
core.setOutput('head_ref', pr.data.head.ref);
core.setOutput('base_ref', pr.data.base.ref);
core.setOutput('head_sha', pr.data.head.sha);

- uses: actions/checkout@v4
with:
ref: ${{ steps.pr.outputs.head_sha }}
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: maven

- name: Build/Test & SonarCloud Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: env.SONAR_TOKEN != ''
run: |
mvn -B clean verify -Pcoverage,sonar \
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
-Dsonar.pullrequest.key=${{ inputs.pr_id }} \
-Dsonar.pullrequest.branch=${{ steps.pr.outputs.head_ref }} \
-Dsonar.pullrequest.base=${{ steps.pr.outputs.base_ref }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Master CI](https://github.com/trackerforce/dot-path-ql/actions/workflows/master.yml/badge.svg)](https://github.com/trackerforce/dot-path-ql/actions/workflows/master.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=trackerforce_dot-path-ql&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=trackerforce_dot-path-ql)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.trackerforce/dot-path-ql.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/io.github.trackerforce/dot-path-ql)
[![Maven Central](https://img.shields.io/maven-central/v/ca.trackerforce/dot-path-ql.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/ca.trackerforce/dot-path-ql)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# dotPathQL
Expand Down Expand Up @@ -31,7 +31,7 @@ The `DotPathQL` is the core component of this project that allows you to extract

```xml
<dependency>
<groupId>io.github.trackerforce</groupId>
<groupId>ca.trackerforce</groupId>
<artifactId>dot-path-ql</artifactId>
<version>${dot-path-ql.version}</version>
</dependency>
Expand Down Expand Up @@ -109,7 +109,7 @@ The utility uses a multi-layered approach to access object properties:
Perfect for creating flexible APIs where clients can specify which fields they need:

```java
import io.github.trackerforce.DotUtils;
import ca.trackerforce.DotUtils;

@GetMapping("/users/{id}")
public Map<String, Object> getUser(
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.github.trackerforce</groupId>
<groupId>ca.trackerforce</groupId>
<artifactId>dot-path-ql</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>

<name>dot-path-ql</name>
<description>dotPathQL allows object attribute filtering</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.github.trackerforce;
package ca.trackerforce;

import io.github.trackerforce.path.*;
import io.github.trackerforce.path.api.DotPath;
import io.github.trackerforce.path.api.DotPrinter;
import ca.trackerforce.path.DotPathFactory;
import ca.trackerforce.path.api.DotPath;
import ca.trackerforce.path.api.DotPrinter;

import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.trackerforce;
package ca.trackerforce;

import io.github.trackerforce.path.DotPathFactory;
import ca.trackerforce.path.DotPathFactory;

import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.github.trackerforce.path;
package ca.trackerforce.path;

import io.github.trackerforce.path.api.DotParse;
import io.github.trackerforce.path.api.DotPath;
import io.github.trackerforce.path.api.DotPrinter;
import ca.trackerforce.path.api.DotParse;
import ca.trackerforce.path.api.DotPath;
import ca.trackerforce.path.api.DotPrinter;

/**
* Factory class for creating instances of DotPath and DotPrinter implementations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.path;
package ca.trackerforce.path;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.trackerforce.path;
package ca.trackerforce.path;

import io.github.trackerforce.path.api.DotPath;
import ca.trackerforce.path.api.DotPath;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.path;
package ca.trackerforce.path;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.path;
package ca.trackerforce.path;

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.trackerforce.path;
package ca.trackerforce.path;

import io.github.trackerforce.path.api.DotParse;
import ca.trackerforce.path.api.DotParse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.trackerforce.path;
package ca.trackerforce.path;

import io.github.trackerforce.path.api.DotPrinter;
import ca.trackerforce.path.api.DotPrinter;

import java.lang.reflect.Array;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.path.api;
package ca.trackerforce.path.api;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.path.api;
package ca.trackerforce.path.api;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.path.api;
package ca.trackerforce.path.api;

/**
* Defines common APIs for printing objects to JSON format.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.trackerforce;
package ca.trackerforce;

import ca.trackerforce.fixture.record.UserDetail;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand All @@ -16,8 +17,8 @@ class DotUtilsTest {

static Stream<Arguments> userDetailProvider() {
return Stream.of(
Arguments.of("Record type", io.github.trackerforce.fixture.record.UserDetail.of()),
Arguments.of("Class type", io.github.trackerforce.fixture.clazz.UserDetail.of())
Arguments.of("Record type", UserDetail.of()),
Arguments.of("Class type", ca.trackerforce.fixture.clazz.UserDetail.of())
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.trackerforce;
package ca.trackerforce;

import ca.trackerforce.fixture.record.UserDetail;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand All @@ -16,8 +17,8 @@ class ExcludeTypeClassRecordTest {

static Stream<Arguments> userDetailProvider() {
return Stream.of(
Arguments.of("Record type", io.github.trackerforce.fixture.record.UserDetail.of()),
Arguments.of("Class type", io.github.trackerforce.fixture.clazz.UserDetail.of())
Arguments.of("Record type", UserDetail.of()),
Arguments.of("Class type", ca.trackerforce.fixture.clazz.UserDetail.of())
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.trackerforce;
package ca.trackerforce;

import io.github.trackerforce.fixture.clazz.customer.Customer;
import ca.trackerforce.fixture.clazz.customer.Customer;
import org.junit.jupiter.api.Test;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.trackerforce;
package ca.trackerforce;

import ca.trackerforce.fixture.record.UserDetail;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand All @@ -16,8 +17,8 @@ class FilterTypeClassRecordTest {

static Stream<Arguments> userDetailProvider() {
return Stream.of(
Arguments.of("Record type", io.github.trackerforce.fixture.record.UserDetail.of()),
Arguments.of("Class type", io.github.trackerforce.fixture.clazz.UserDetail.of())
Arguments.of("Record type", UserDetail.of()),
Arguments.of("Class type", ca.trackerforce.fixture.clazz.UserDetail.of())
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.trackerforce;
package ca.trackerforce;

import io.github.trackerforce.fixture.clazz.customer.Customer;
import ca.trackerforce.fixture.clazz.customer.Customer;
import org.junit.jupiter.api.Test;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.trackerforce;
package ca.trackerforce;

import ca.trackerforce.fixture.record.UserDetail;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand All @@ -17,8 +18,8 @@ class PrintTypeClassRecordTest {

static Stream<Arguments> userDetailProvider() {
return Stream.of(
Arguments.of("Record type", io.github.trackerforce.fixture.record.UserDetail.of()),
Arguments.of("Class type", io.github.trackerforce.fixture.clazz.UserDetail.of())
Arguments.of("Record type", UserDetail.of()),
Arguments.of("Class type", ca.trackerforce.fixture.clazz.UserDetail.of())
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz;
package ca.trackerforce.fixture.clazz;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz;
package ca.trackerforce.fixture.clazz;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz;
package ca.trackerforce.fixture.clazz;

import java.util.Date;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz;
package ca.trackerforce.fixture.clazz;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz;
package ca.trackerforce.fixture.clazz;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz.customer;
package ca.trackerforce.fixture.clazz.customer;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz.customer;
package ca.trackerforce.fixture.clazz.customer;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.clazz.customer;
package ca.trackerforce.fixture.clazz.customer;

import lombok.Setter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.record;
package ca.trackerforce.fixture.record;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.record;
package ca.trackerforce.fixture.record;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.record;
package ca.trackerforce.fixture.record;

import java.util.Date;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.record;
package ca.trackerforce.fixture.record;

public record Product(
String id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.trackerforce.fixture.record;
package ca.trackerforce.fixture.record;

import java.util.List;
import java.util.Map;
Expand Down
Loading