Skip to content

Commit

Permalink
add github api here as well
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Lamy <olamy@apache.org>
  • Loading branch information
olamy committed Dec 3, 2024
1 parent 8a694e6 commit 4e1356e
Show file tree
Hide file tree
Showing 72 changed files with 7,480 additions and 1 deletion.
1 change: 0 additions & 1 deletion webtide-github-api
Submodule webtide-github-api deleted from f6004e
58 changes: 58 additions & 0 deletions webtide-github-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>

<parent>
<groupId>net.webtide.tools</groupId>
<artifactId>webtide-release-tools</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>webtide-github-api</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.3.1-jre</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
<version>6.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>2.0.16</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>6.10.0.202406032230-r</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// ========================================================================
// Copyright (c) Webtide LLC and others.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License, Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: Apache-2.0
// ========================================================================
//

package net.webtide.tools.github;

import java.time.ZonedDateTime;

public class Authorship
{
protected String name;
protected String email;
protected ZonedDateTime timestamp;

public String getName()
{
return name;
}

public String getEmail()
{
return email;
}

public ZonedDateTime getTimestamp()
{
return timestamp;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// ========================================================================
// Copyright (c) Webtide LLC and others.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License, Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: Apache-2.0
// ========================================================================
//

package net.webtide.tools.github;

public class BaseHeadRef
{
protected String label;
protected String ref;
protected String sha;
protected User user;
protected Repository repo;

public String getLabel()
{
return label;
}

public String getRef()
{
return ref;
}

public String getSha()
{
return sha;
}

public User getUser()
{
return user;
}

public Repository getRepo()
{
return repo;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// ========================================================================
// Copyright (c) Webtide LLC and others.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License, Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: Apache-2.0
// ========================================================================
//

package net.webtide.tools.github;

import java.io.IOException;

public interface Cache
{
/**
* Get the Cached contents of the path provided.
*
* @param path the path
* @return the contents, or null if not in cache.
* @throws GitHubResourceNotFoundException if path is known, and is recorded as not found.
* @throws IOException if unable to load cached contents.
*/
String getCached(String path) throws GitHubResourceNotFoundException, IOException;

/**
* Save to the cache a not found path.
* <p>
* Will result in a GitHubResourceNotFoundException for all requests for the same path on {@link #getCached(String)}
* </p>
*
* @param path the path that wasn't found
* @throws IOException if unable to save the cache entry
*/
void saveNotFound(String path) throws IOException;

/**
* Save to the cache the body content.
*
* @param path the path to cache
* @param body the contents to cache
* @throws IOException if unable to save the cache entry
*/
void save(String path, String body) throws IOException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// ========================================================================
// Copyright (c) Webtide LLC and others.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License, Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: Apache-2.0
// ========================================================================
//

package net.webtide.tools.github;

import java.io.IOException;
import java.time.ZonedDateTime;

public class Card
{

protected String note;
protected ZonedDateTime createdAt;
protected ZonedDateTime updatedAt;
protected Issue issue;
protected String content_url;

public String getNote()
{
return note;
}

public ZonedDateTime getCreatedAt()
{
return createdAt;
}

public ZonedDateTime getUpdatedAt()
{
return updatedAt;
}

protected String getContentUrl()
{
return content_url;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// ========================================================================
// Copyright (c) Webtide LLC and others.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License, Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: Apache-2.0
// ========================================================================
//

package net.webtide.tools.github;

import java.util.ArrayList;

public class Cards extends ArrayList<Card>
{
@Override
public boolean add(Card card)
{
return super.add(card);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// ========================================================================
// Copyright (c) Webtide LLC and others.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License, Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: Apache-2.0
// ========================================================================
//

package net.webtide.tools.github;

import java.io.IOException;
import java.time.ZonedDateTime;

public class Column
{
private long id;
protected String name;
protected ZonedDateTime createdAt;
protected ZonedDateTime updatedAt;

public String getName()
{
return name;
}

public ZonedDateTime getCreatedAt()
{
return createdAt;
}

public ZonedDateTime getUpdatedAt()
{
return updatedAt;
}

public long getId()
{
return id;
}

@Override
public String toString()
{
return "Column{" + "id=" + id + ", name='" + name + '\'' + ", createdAt=" + createdAt + ", updatedAt="
+ updatedAt + '}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// ========================================================================
// Copyright (c) Webtide LLC and others.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License, Version 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: Apache-2.0
// ========================================================================
//

package net.webtide.tools.github;

import java.util.ArrayList;

public class Columns extends ArrayList<Column>
{
@Override
public boolean add(Column column)
{
return super.add(column);
}

}
Loading

0 comments on commit 4e1356e

Please sign in to comment.