Skip to content
Snippets Groups Projects

Initial commit of work

Merged Martin Lowe requested to merge github/fork/autumnfound/malowe/master/1 into master

Not final, but represents ~90% completion state

Signed-off-by: Martin Lowe martin.lowe@eclipse-foundation.org

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
51 <artifactId>quarkus-resteasy-jackson</artifactId>
52 </dependency>
53 <dependency>
54 <groupId>io.quarkus</groupId>
55 <artifactId>quarkus-rest-client</artifactId>
56 </dependency>
57 <dependency>
58 <groupId>com.github.scribejava</groupId>
59 <artifactId>scribejava-apis</artifactId>
60 <version>6.4.1</version>
61 </dependency>
62 <dependency>
63 <groupId>org.gitlab4j</groupId>
64 <artifactId>gitlab4j-api</artifactId>
65 <version>4.14.11</version>
66 </dependency>
  • Christopher Guindon
  • 38 if (c.getCommitter() == null || c.getCommitter().getMail() == null) {
    39 valid = false;
    40 }
    41
    42 return valid;
    43 }
    44
    45 /**
    46 * Retrieves the email address associated with a commit message. This is done by
    47 * processing the body and parsing out the given footer knowing its format.
    48 *
    49 * @param c the commit to retrieve the signed off by footer for
    50 * @return the email address in the Signed-off-by footer, or null if none could
    51 * be found.
    52 */
    53 public static String getSignedOffByEmail(Commit c) {
  • Christopher Guindon
  • 8 /**
    9 * Contains helpers for processing commits.
    10 *
    11 * @author Martin Lowe
    12 *
    13 */
    14 public class CommitHelper {
    15 private static final Pattern SIGNED_OFF_BY_FOOTER = Pattern.compile("Signed-off-by:(.*)<(.*@.*)>$");
    16
    17 /**
    18 * Validate the commits fields.
    19 *
    20 * @param c commit to validate
    21 * @return true if valid, otherwise false
    22 */
    23 public static boolean validateCommit(Commit c) {
  • Christopher Guindon
  • Author Maintainer

    I've added a ton of unit tests, and added secret config fetch code for k8s secret stuff we will need later. Also fixed that I was missing license info in a lot of files. Did a lot of code clean up with some help from Sonar.

  • Christopher Guindon
  • 54 }
    55 // load the secrets file in
    56 File f = new File(secretPath);
    57 if (!f.exists() || !f.canRead()) {
    58 LOGGER.error("File at path {} either does not exist or cannot be read", secretPath);
    59 return this.secrets;
    60 }
    61
    62 // read each of the lines of secret config that should be added
    63 try (BufferedReader br = new BufferedReader(new FileReader(f))) {
    64 Properties p = new Properties();
    65 p.load(br);
    66 secrets.putAll((Map) p);
    67
    68 } catch (IOException e) {
    69 LOGGER.error("Error while reading in secrets configuration file.", e);
  • Martin Lowe
    Martin Lowe @malowe started a thread on commit cb048eec
  • 54 }
    55 // load the secrets file in
    56 File f = new File(secretPath);
    57 if (!f.exists() || !f.canRead()) {
    58 LOGGER.error("File at path {} either does not exist or cannot be read", secretPath);
    59 return this.secrets;
    60 }
    61
    62 // read each of the lines of secret config that should be added
    63 try (BufferedReader br = new BufferedReader(new FileReader(f))) {
    64 Properties p = new Properties();
    65 p.load(br);
    66 secrets.putAll((Map) p);
    67
    68 } catch (IOException e) {
    69 LOGGER.error("Error while reading in secrets configuration file.", e);
    • Author Maintainer

      This is a common class across multiple APIs, its a target for extraction to a separate project for consumption as a dependency. WDYT?

    Please register or sign in to reply
    Loading