GithubHelp home page GithubHelp logo

kinsondigital / kd_clients Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 269 KB

Various HTTP clients for miscellaneous use.

Home Page: https://deno.land/x/kd_clients

License: MIT License

TypeScript 99.80% PowerShell 0.03% Shell 0.09% Batchfile 0.08%
clients http http-clients

kd_clients's People

Contributors

calvinwilkinson avatar kselena avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

kd_clients's Issues

🚧Improve release workflow

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Improve the release workflow by automatically creating a GitHub release.

Acceptance Criteria

  • Release workflow updated

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Migrate project to JSR

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Migrate the project to JSR.

Follow the docs to properly convert imports and configuration of the project so it is compatible with JSR.

This will also involve dealing with any slow types as well as doc generation.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add download func to the release client

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add a function named downloadAllLatestReleaseAssets to the ReleaseClient.

This will work just like the downloadAllAssetsByReleaseName and downloadAllAssetsByReleaseTag functions except that they will download all the assets for the latest release.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Update clients to check for authentication issues

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Currently, a lot of the GitHub clients do not specifically catch an authentication HTTP status code of 403 or something similar.

Fix this by going through each GitHub client to properly check for this error, and throwing a proper authentication error. The error to throw should be a custom authentication error named AuthError. The error should have the default message inherited from Error, but also have a property named InnerErrorMessage, which represents the original error from the API.

Note

Refer to the GitHub REST API docs to get info about authentication error results.

Example:
A good example of this is the RepoClient.getVariables() function. This function makes the HTTP REST API call, but it only checks if the returned status code is not equal to OK, and that is it. This means if an authentication error is returned, it will still return the same non-informative error and the user will not know that it is an authentication error.

public async getVariables(): Promise<GitHubVarModel[]> {
return await this.getAllData<GitHubVarModel>(async (page: number, qtyPerPage?: number) => {
const queryString = `?page=${page}&per_page=${qtyPerPage}`;
const url = `${this.baseUrl}/repos/${this.ownerName}/${this.repoName}/actions/variables${queryString}`;
const response = await this.requestGET(url);
if (response.status != GitHubHttpStatusCodes.OK) {
const errorMsg = this.buildErrorMsg(
`An error occurred when getting the variables for the owner '${this.ownerName}'.`,
response);
throw new RepoError(errorMsg);
}
const vars = await this.getResponseData<GitHubVariablesModel>(response);
return [vars.variables, response];
});
}

Acceptance Criteria

The following clients are refactored to deal with auth errors

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix wrong media content issue

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

After using any of the download asset functions in the ReleaseClient, any subsequent calls to get assets throw an incorrect media type error.

This is because the download asset functions use the application/octet-stream for the content type but never change the header back to the way it was before updating it. This leaves the octet media type header in place for other requests that require a different media type.

In the download functions, get the current media type before setting the content header to octet-stream, and then set the value back to the value before it was changed.

Important

Make sure to do this in other areas of the logic, such as try-catch blocks and error-processing blocks.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Update dependencies

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Check various dependencies and update them

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add folder and file inspection feature

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add the ability to do the following with folders and files in the RepoClient.

  1. Ability to check if a folder exists in a folder
  2. Ability to check if a file exists in a folder
  3. Ability to get a list of folders contained in another folder
  4. Ability to get a list of files contained in another folder
Sample Code

import { Guards, Utils } from "../../deps.ts";
import { RepoClient } from "../../deps.ts";
import { FileOrFolder } from "../../deps.ts";

export class RepoFileService {
	private readonly fileRegex: RegExp;
	private readonly orgName: string;
	private readonly repoName: string;
	private readonly token: string;
	private readonly repoClient: RepoClient;

	constructor(orgName: string, repoName: string, token: string) {
		Guards.isNothing(orgName);
		Guards.isNothing(repoName);
		Guards.isNothing(token);

		this.fileRegex = /^.+\..+$/gm;
		this.orgName = orgName;
		this.repoName = repoName;
		this.token = token;

		this.repoClient = new RepoClient(orgName, repoName, token);
	}

	public async folderExists(folderPath: string): Promise<boolean> {
		Guards.isNothing(folderPath);

		// Strip leading and trailing slashes
		folderPath = folderPath.startsWith("/") ? folderPath.substring(1) : folderPath;
		folderPath = folderPath.endsWith("/") ? folderPath.substring(0, folderPath.length - 1) : folderPath;
		
		let parentFolder = "";

		if (this.fileRegex.test(folderPath)) {
			Utils.printGitHubError(`The file name '${folderPath}' is not a valid folder path.`);
			Deno.exit(1);
		}

		if (folderPath.includes("/")) {
			const parts = folderPath.split("/");
			parentFolder = parts.slice(0, parts.length - 1).join("/");
		}

		const filesAndFolders = await this.getFilesAndFolders(parentFolder);

		return filesAndFolders.some(f => this.isDir(f.type) && f.name === folderPath);
	}

	public async fileExists(filePath: string) : Promise<boolean> {
		Guards.isNothing(filePath);

		filePath = filePath.trim();

		let folderName = "";
		let fileName = "";
		
		if (filePath.includes("/")) {
			const parts = filePath.split("/");
			fileName = parts[parts.length - 1];
			
			if (!this.fileRegex.test(fileName)) {
				Utils.printGitHubError(`The file name '${fileName}' is not a valid file name.`);
				Deno.exit(1);
			}

			folderName = parts.slice(0, parts.length - 1).join("/");
		} else {
			if (!this.fileRegex.test(fileName)) {
				Utils.printGitHubError(`The file name '${fileName}' is not a valid file name.`);
				Deno.exit(1);
			}

			fileName = filePath;
		}

		const filesAndFolders = await this.getFilesAndFolders(folderName);

		return filesAndFolders.some(f => this.isFile(f.type) && f.name === fileName);
	}

	private async getFilesAndFolders(relativePath: string): Promise<FileOrFolder[]> {
		// Guards.isNothing(relativePath);

		const baseUrl = "https://api.github.com";
		const url = `${baseUrl}/repos/KinsonDigital/Velaptor/contents/${relativePath}`;
		
		const result = await fetch(url, {
			method: "GET",
			headers: {
				"Authorization": `Bearer ${this.token}`,
				"Accept": "application/vnd.github+json",
				"X-Github-Api-Version": "2022-11-28"
			},
		});
		
		if (result.status != 200) {
			console.error(result.statusText);
			Deno.exit(1);
		}
		
		const data = await result.json() as FileOrFolder[];

		return data;
	}

	private isFile(type: string): type is "file" {
		return type === "file";
	}

	private isDir(type: string): type is "dir" {
		return type === "dir";
	}
}

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add update release body func to release client

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add a new function to the release client to allow the updating of a GitHub release body.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix release workflow tweet process

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

In the release workflow, the script URL for sending a release tweet is not fully formed and missing the script file name/relative path.

Fix this and improve pathing in the entire workflow.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Replace twitter npm package

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Currently, the XClient is using the [email protected] npm package internally. This is causing issues when it comes npm package support in some systems such as with supabase edge functions.

To solve this issue, replace the npm package with a deno compatible version that can do the same thing as the npm package, or create a custom implementation.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add 401 checks to github clients

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Go through all GitHub clients and add checks for the HTTP 401 Unauthorized status code if it does not exist.

If this status code exists, throw an AuthError with the correct message.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/build-status-check.yml
  • actions/checkout v4
  • denoland/setup-deno v1
.github/workflows/lint-status-check.yml
  • actions/checkout v4
  • denoland/setup-deno v1
.github/workflows/prepare-release.yml
  • KinsonDigital/Infrastructure v13.6.3
.github/workflows/release.yml
  • denoland/setup-deno v1
  • actions/checkout v4
  • denoland/setup-deno v1
  • actions/checkout v4
  • denoland/setup-deno v1
  • actions/checkout v4
  • softprops/action-gh-release v2
.github/workflows/sync-bot.yml
  • denoland/setup-deno v1
.github/workflows/sync-pr-to-issue.yml
  • KinsonDigital/Infrastructure v13.6.3
  • KinsonDigital/Infrastructure v13.6.3
.github/workflows/sync-status-check.yml
  • denoland/setup-deno v1
.github/workflows/test-status-check.yml
  • actions/checkout v4
  • denoland/setup-deno v1

  • Check this box to trigger a request for Renovate to run again on this repository

🚧Add new funcs to release client

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add some functions to the ReleaseClient to delete and upload assets from a release.

Delete single asset:

  1. If the asset does not exist, an error will be thrown.
    • The error will only be thrown if the 'errorIfMissingis set totrue`

Upload single asset functions:

  1. Create a function that uploads a single asset to a release by a release tag
    • If the asset to replace already exists, it will be replaced. But only if the overwrite param is set to true
  2. Create a function that uploads a single asset to a release by a release name
    • If the asset to replace already exists, it will be replaced. But only if the overwrite param is set to true

Asset Exists:

  1. Create a function that checks if a release asset exists by asset name

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Create prepare release workflow

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Create a workflow that helps prepare the release by creating the release notes and updating the version. Use the prepare release workflow from the Velaptor repository as a starting point.

The updating of the version will have to be done differently than in Velaptor. It exists in the deno.json. Currently the PrepareReleaseRunner in the Infrastructure repository needs to be updated to pull versions from deno files before this can be implemented.

Also, update the applicable workflows that use the pull_request_target trigger to use the preview branch in addition to the main branch.

With the creation of a preview branch, the release workflow will probably need to be updated.

Note
This is going to require this project to start using preview branches.

Acceptance Criteria

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add getAllReleases() func to release client

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add a new function to the ReleaseClient to get all of the releases as an array.

Reason:
Some users are saying that they need to get all of the releases so they can perform their own filtering or processing of the releases. Currently, the only function available is the public function named getReleases(), but this takes the page and qtyPerPage parameters. This forces the user to implement their own pagination code to get all of the releases. This is not good DX..

Add a new function named getAllReleases() which will simply get all of the releases as an array.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

📋Improve the CLI and Directory types

Complete The Item Below

  • I have updated the title without removing the 📋 emoji.

Description

Make improvements to the CLI class to better handle directory and file paths as well as make use of the Deno.execPath() API.

CLI Class Code:

/**
 * A simple CLI command wrapper.
 */
export class CLI {
	/**
	 * Runs the following CLI {@link command}.
	 * @param command The command to run.
	 * @returns The output of the command if successful, otherwise an error.
	 */
	public async runAsync(command: string): Promise<string | Error> {
		if (command === undefined || command === null || command === "") {
			const errorMsg = "The command parameter cannot be null or empty.";
			console.log(errorMsg);
			Deno.exit(1);
		}

		command = command.includes("'")
			? command.replace(/'/g, '"')
			: command;

		const sections: string[] = command.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) ?? [];

		const app = sections[0] === "deno" ? Deno.execPath() : sections[0];
		const args = sections.slice(1).map(arg => arg.replace(/"/g, ''));

		const cmd = new Deno.Command(app, { args: args });

		const { code, stdout, stderr } = await cmd.output();

		if (code === 0) {
			return new TextDecoder().decode(stdout);
		} else {
			return new Error(new TextDecoder().decode(stderr));
		}
	}
}

Directory.getFiles() Function

/**
 * Gets a list of files in the given {@link dirPath}.  This will search recursively
 * if {@link recursive} is true.
 * @param dirPath The path of the directory start searching.
 * @param extension The file extension to search for.
 * @param recursive True to search recursively, otherwise false.
 * @returns {string[]} A list of files in the given {@link dirPath}.
 */
public static getFiles(dirPath: string, extension:string, recursive = false): string[] {
	let files: string[] = [];

	extension = extension.trim();

	const extensionRegex = /\.[a-zA-Z]/g;

	extension = Utils.isNothing(extension) ? "*.*" : extension;

	if (extension != "*.*") {
		extension = extension.startsWith("*.") ? extension.substring(1) : extension;

		if (!extension.startsWith(".") || extension.length === 1) {
			const errorMsg = `The extension '${extension}' is not supported.\n` +
								`Must be a value of '*.*' or '*.<extension>'.`;
			console.log(errorMsg);
			throw new Error(errorMsg);
		}
	}

	if (dirPath === undefined || dirPath === null || dirPath === "") {
		const errorMsg = "The dirPath parameter cannot be null or empty.";
		console.log(errorMsg);
		Deno.exit(1);
	}

	dirPath = dirPath === "." || dirPath === "./" ? Deno.cwd() : dirPath;

	for (const dirEntry of Deno.readDirSync(dirPath)) {
		const entry = dirPath + "/" + dirEntry.name;

		if (recursive && dirEntry.isDirectory) {
			files = [...files, ...(Directory.getFiles(entry, extension, recursive))];
		} else if (dirEntry.isFile) {
			if (extension === "*.*") {
				files.push(entry);
			} else {
				if (entry.endsWith(extension)) {
					files.push(entry);
				}
			}
		}
	}

	return files;
}

Adjust deno-check.ts Script:

const files: string[] = Directory
-	.getFiles("/", ".ts", true)
+	.getFiles("./", ".ts", true)
	.filter(f => ignoreDirectories.every(ignoreDir => !f.startsWith(ignoreDir)));

Acceptance Criteria

Tasks

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.

Additional Information:

Change Type Labels

Change Type Label
CICD https://github.com/KinsonDigital/VelaptorDocs/labels/%E2%99%BB%EF%B8%8Fcicd
Dependency Update https://github.com/KinsonDigital/VelaptorDocs/labels/%F0%9F%93%A6dependency%20update
Miscellaneous https://github.com/KinsonDigital/VelaptorDocs/labels/miscellaneous
Tutorial Doc Changes https://github.com/KinsonDigital/VelaptorDocs/labels/%F0%9F%93%9Ctutorial%20doc%20changes

Priority Type Labels

Priority Type Label
Low Priority https://github.com/KinsonDigital/VelaptorDocs/labels/low%20priority
Medium Priority https://github.com/KinsonDigital/VelaptorDocs/labels/medium%20priority
High Priority https://github.com/KinsonDigital/VelaptorDocs/labels/high%20priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix release workflow

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Fix an issue with the release workflow with a missing argument to the close milestone script.

This is on line #158 in the release.yml workflow. The organization name is missing as the first argument.

Acceptance Criteria

The items to complete in order to satisfy the Definition of Done.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix create org client issue

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

When creating a new OrgClient object, an error is thrown that the repoName is null, undefined, or empty when it is not.

Error Details

error: Uncaught Error: The value is null, undefined, or empty.
Function Name: repoName
Param Name: v
			throw new Error(errorMsg);
			      ^
    at Function.isNothing (https://deno.land/x/[email protected]/core/Guard.ts:28:10)
    at OrgClient.set repoName (https://deno.land/x/[email protected]/core/GitHubClient.ts:64:9)
    at new GitHubClient (https://deno.land/x/[email protected]/core/GitHubClient.ts:27:16)
    at new OrgClient (https://deno.land/x/[email protected]/GitHubClients/OrgClient.ts:23:3)
    at AddItemToProjectRunner.validateArgs (file:///K:/SOFTWARE-DEV/PERSONAL/Infrastructure/cicd/scripts/runners/AddItemToProjectRunner.ts:78:21)
    at AddItemToProjectRunner.run (file:///K:/SOFTWARE-DEV/PERSONAL/Infrastructure/cicd/scripts/runners/ScriptRunner.ts:63:14)
    at AddItemToProjectRunner.run (file:///K:/SOFTWARE-DEV/PERSONAL/Infrastructure/cicd/scripts/runners/AddItemToProjectRunner.ts:35:15)
    at file:///K:/SOFTWARE-DEV/PERSONAL/Infrastructure/cicd/scripts/add-item-to-project.ts:4:32

After digging into the issue, the org client is sending in an empty string literal into the super() call which is type GitHubClient. In the GitHubClient class, the constructor contains a guard that checks if the repoName argument is null and throws an error when it is. Which in this case it always is.

Just send in the value na to fix this issue.

Acceptance Criteria

The items to complete in order to satisfy the Definition of Done.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add func options to IssueClient

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

With various functions in the IssueClient, add an options parameter to functions where using options would make sense to use.

A good example would be the getIssues() function. The following params could be added to an options param instead.

  1. state
  2. labels
  3. milestoneNumber

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Setup KDAdmin

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Install and set up KDAdmin
Use this command to install KDAdmin:

  deno run -Ar https://raw.githubusercontent.com/KinsonDigital/kd-admin/preview/installation/install.ts latest

Note

If the create-pr.ps1 file already exists, the tool will skip the file.
If this happens, set the content of the file to the content below:

& "dev-tools/bin/kd-admin" create-pr;

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Setup CICD and pr sync

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

This is the initial creation of the project. Everything from code, config, ide settings, deno settings, etc.

Release Workflow

The release workflow needs to be able to run linting, run tests, and then create an empty commit with a tag that is the version number. This number should be chosen when manually running the release workflow. All validation of inputs should be performed.

Prepare Release Templates:

Create new prepare release templates based on the ones that already exist in infrastructure.
Create these templates in this repo, not in the Infrastructure repo.

This will require the use of the following repo variables:

  • PREV_RELATIVE_PR_RELEASE_TEMPLATE_FILE_PATH
  • PROD_RELATIVE_PR_RELEASE_TEMPLATE_FILE_PATH
  • PR_RELEASE_TEMPLATE_REPO_NAME

    Note
    This variable will hold the name of the repo where the templates exist

Acceptance Criteria

  • Setup PR syncing system
  • Build status check workflow created

    Note
    This uses the new deno-check.ts script

  • Setup test status check workflow
  • Setup linting status check workflow
  • Setup release workflow
    • Runs linting
    • Runs tests
    • Creates an empty commit, tags that commit, and pushes all to remote
    • Version validation run against the incoming workflow version input
    • DENO_VERSION variable setup and used in all workflows
  • Prepare release templates created
  • Packages vendored

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Create default module for models

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Create a default mod.ts module for the models in the Models and Models/GraphQlModels directories.

The GraphQL modules should be also imported into the Models folder and reexported. This will give the option to the user to point to the Models mod.ts module and get every single model or to reference the mod.ts module for the GraphQL modules only.

Acceptance Criteria

  • default module added to the Models/GraphQlModels directory
  • default module added to the Models directory
    • Models/GraphQlModels mod.ts imported into the

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix update repo file bug

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Fix a bug where updating a repo file using the RepoClient.updateFile() function throws an error when the file that is trying to be updated already exists.

Expected Behavior:
The error should only be thrown if the file does not exist.

Acceptance Criteria

The items to complete in order to satisfy the Definition of Done.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add function to check if an asset exists by name

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add a new function to the ReleaseClient that takes a release id or name and an asset name parameter and returns a result indicating whether the asset exists in the release.

Add the following function signature:

public async assetExists(releaseIdOrName: number | string, assetName: string): Promise<boolean>;

This function will dynamically check if the release is an id number or name string and then use the asset name to check if the asset exists.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Change client param to not required

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Change the token parameter in the OrgClient constructor from optional to required.

Acceptance Criteria

The items to complete in order to satisfy the Definition of Done.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add upload asset feature to release client

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Update the release client to give the ability to upload assets to an existing release.

Should have the following capabilities:

  1. Upload a single asset
  2. Upload multiple assets via an array of files
  3. Check to make sure that the release exists first
  4. Can take the title of a release as a parameter when choosing a release to upload assets to

Acceptance Criteria

The items to complete in order to satisfy the Definition of Done.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Update code check steps

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Update all of the code check steps to all execute even if they fail. Failure will be performed in another new step that will analyze the results of the code check steps. If any of them fail, then the whole workflow will failed.

Reason:
This is to allow runs to know if any of the other code checks have failed even if one code check has failed.

The code check steps to update are:

  1. Run Lint
  2. Run Tests
  3. Run Build

These steps will be changed to use the continue-on-error: true setting so that way they do not fail the workflow if the check fails.

Refactorings:

  1. Refactor the name of the Run Build step to Deno Check
  2. Refactor the name of the Run Lint step to Deno Lint

Things to add:

  1. Add a new step for running deno format checking.
    • The name of the step will be Deno Format
    • Use the command deno fmt --check
    • This step will also use the continue-on-error: true setting
  2. After all of the code check steps, add a new step named Validate Checks that will check all of the previous code check steps to see if they have failed. If any of them has failed, the entire workflow will fail.
    • This step should print a GitHub error message of all the steps that have failed.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add state type for issue and pr models

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Create a type for the different states for the IssueModel and PullRequestModel interfaces.

The different states are:

  • open
  • closed

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Improve pull request client

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Improve the pull request client by updating the function to request reviewers for a pull request. Currently, the function only requests a single reviewer at a time. This is not ideal in situations where you have multiple reviewers to assign because you would need to use a loop to perform a request for each reviewer.

The GitHub REST API endpoint has the ability to send multiple reviewers, but the function/client is simply not taking advantage of it.

What to do:

  1. Refactor the name of the requestReviewer function to requestReviewers
  2. Refactor the requestReviewer parameter named reviewer to the name reviewers
  3. Change the reviewer parameter type from string to string | string[].

    Note
    This will internally always send an array. This is just to make it easy for the user

Note
The name of the class to make these changes is PullRequestClient

Warning
This introduces https://github.com/KinsonDigital/kd_clients/labels/%F0%9F%A7%A8breaking%20changes

Acceptance Criteria

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧 Fix NuGet client issue

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Fix an issue with the NuGetClient checking if a NuGet package exists for a specific version.

The issue exists packageWithVersionExists() function. The client needs to setup a default **Accept** header with a value of json.

Acceptance Criteria

The items to complete in order to satisfy the Definition of Done.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Replace chalk npm package

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Currently, the project is using the [email protected] npm package.

Replace this package with a deno equivalent, or with a custom implementation.

When checking for a deno equivalent, check the project source code to make sure that it is not using any npm packages itself as a dependency.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix import issue in mod files

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Fix all of the mod.ts files in the project to use relative paths instead of the import maps.

This is causing issues when consuming the library as a user.

Also, replace all of the uses of Deno.exit(1) in the clients and other areas with proper replacement code.

Acceptance Criteria

  • All mod.ts files fixed
  • Remove all Deno.exit(1) uses
  • Following clients refactored to return or throw errors instead of print and exit
    • GitHub Clients
      • GitClient.ts
      • IssueClient.ts
      • LabelClient.ts
      • MilestoneClient.ts
      • OrgClient.ts
      • ProjectClient.ts
      • PullRequestClient.ts
      • ReleaseClient.ts
      • RepoClient.ts
      • TagClient.ts
      • UsersClient.ts
      • WorkflowClient.ts
  • Others
    • XClient.ts
    • NuGetClient.ts
  • Make the GitHubClient ctor params with the names ownerName and repoName required
  • Perform simple cleanup
    • Replace all !== with !=
  • Remove all uses of github action related messages
    • Remove functions from Utils.ts

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add ability to download release assests

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add methods to the ReleaseClient to be able to download release assets.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Convert all models to interfaces

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Convert all of the model types to interfaces.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Add options to get variables function

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Add some options to the getVariables() function in the RepoClient and OrgClient class. These options will be used to signify how to trim the variable values.

Add the following options:

  1. Add the ability to trim spaces, \n, and \r characters from the beginning and end of the variable values.
  2. Add the ability to return all of the values in uppercase or lowercase

Each option should be available and performed using an enum. The different enum values will represent a different trimming behavior.

Here are the trimming behaviors:

Warning

Do not use a standard typescript enum. This has some pitfalls and it is recommended to do something different.
More info about this can be found here

const TrimType = {
    TrimNL: "TrimNL",
    TrimNLStart: "TrimNLStart",
    TrimNLEnd: "TrimNLEnd",
    TrimCR: "TrimCR",
    TrimCRStart: "TrimCRStart",
    TrimCREnd: "TrimCREnd",
    TrimNLAndCR: "TrimNLAndCR",
    TrimNLAndCRStart: "TrimNLAndCRStart",
    TrimNLAndCREnd: "TrimNLAndCREnd",
    TrimSpaces: "TrimSpaces",
    TrimSpacesStart: "TrimSpacesStart",
    TrimSpacesEnd: "TrimSpacesEnd",
    TrimAllSpacesAndNLCR: "TrimAllSpacesAndNLCR",
	None: "None",
} as const; // This prevents the object from being mutated

type EnumValues<T> = T[keyof T];
type TrimType = EnumValues<typeof TrimType>;

// Use Examples Below

// How to use
function trim(trimType: TrimType) {
    console.log(trimType);
}

trim(TrimType.TrimCR);

// OR

trim("TrimCR");

Options Object Type:

type ValueOptions = {
    trimming?: TrimType,
    casing?: 'lower-case' | 'upper-case',
}

Note

NL = New Line = \n
CR = Carriage Return = \r

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Rename client functions

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Rename the following client functions:

  1. MilestoneClient.milestoneExists to exists
  2. LabelClient.labelExists to exists
  3. PullRequestClient.pullRequestExists to exists
  4. PullRequestClient.openPullRequestExists to openExists
  5. PullRequestClient.closedPullRequestExists to closedExists
  6. IssueClient.issueExists to exists
  7. IssueClient.openIssueRequestExists to openExists
  8. IssueClient.closedIssueRequestExists to closedExists
  9. ReleaseClient.releaseExists to exists
  10. RepoClient.repoVariableExists to variableExists
  11. TagClient.tagExists to exists
  12. Combine the following functions and rename the combined function:
    • Combine NuGetClient.packageExists to NuGetClient.packageWithVersionExists
    • Set the name of the function to exists

Reason:
This is how the rest

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix bug with getting issues via labels

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Fix a bug that prevents getting a list of issues using the IssueClient.getIssues() function from working correctly by filtering the issues with a list of labels.

Currently, when getting a list of issues while passing in a list of labels, all issues with any label will be returned. The intended behavior is that if any labels are sent into the function, only labels that contain any of the labels will be returned.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

🚧Fix getting repo data bug

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Fix a bug where getting repository data using the RepoClient.getRepo() function only works if the name of the repository is all lowercase.

Acceptance Criteria

The items to complete in order to satisfy the Definition of Done.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct milestone (if applicable).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.