Skip to content

Commit 7510431

Browse files
committed
Migrated codebase to work as an action (#48)
Updated codebase to run as an action instead of a application. This PR mainly removes most of the boilerplate and code unrelated to the action itself and adapts everything to work in a more organized and abstract way. It splits the architecture into an object oriented dependency injection system, having the class `Synchronizer` handling all the business logic and the classes `ProjectKit`,`IssueKit` and `CoreLogger` handling specific subtasks. To be able to fine-grain the project permissions and keep the highest level of security possible while maintaining a sane codebase, the action of each token has been split into its own class: - ProjectKit uses a PAT with organization access as it needs to interact with the project API (which is part of an organization instead of a repository). - IssueKit uses the autogenerated GitHub token to fetch information from the issues API available in the repository. `ProjectKit` is still in development, as it's missing the ability to update custom fields (#44) and it's using a deprecated API (#46) so it's prone to changes in the following PRs. This PR is aimed at a feature branch and not at the master branch. The reason for this is because this task does not contemplate all the necessary features to launch this action. This is the first task of many which can be found in the milestone: [GitHub Action port](https://github.com/paritytech/github-issue-sync/milestone/1). Once all this tasks have been completed, the feature branch will be merged into master replacing the current functionality. This PR also removes the ability to use custom labeling and custom fields. This will be added later to the feature branch. The action was ported to work as a Docker image instead of a JavaScript image. This is because the docker image allows to build the action on demand (currently ~45 seconds). A more efficient method will be proposed later but for the current development process this satisfies the requirements. This PR resolves #43.
1 parent 1a81f7f commit 7510431

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2566
-4917
lines changed

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
node_modules
2-
build/*
3-
!build/package.json
42
dist

.eslintrc.cjs

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ updates:
66
schedule:
77
interval: "daily"
88
ignore:
9-
# @types/node should be bumped manually once we change the Node.js version used
10-
- dependency-name: "@types/node"
119
- dependency-name: "*"
1210
# Ignore version upgrades.
1311
# Security updates are nevertheless. unaffected by this setting and will continue to work.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Continuous testing
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Use node 18
11+
uses: actions/setup-node@v3
12+
with:
13+
node-version: 18
14+
- name: Install dependencies
15+
run: yarn install --immutable
16+
- name: Run tests
17+
run: yarn test
18+
- name: Build the project
19+
run: yarn build

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# deps
2-
node_modules
2+
/node_modules
33

44
# TypeScript compilation directory
5-
build/*
6-
!build/package.json
5+
/dist
76

87
# ncc output directory used for the action release
98
# normally the package would be ignored, but in this case it shouldn't because
@@ -14,3 +13,4 @@ build/*
1413
yarn-error.log
1514

1615
.idea
16+
.DS_Store

.gitlab-ci.yml

Lines changed: 0 additions & 164 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.prettierrc.cjs

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:18
2+
3+
COPY package.json yarn.lock ./
4+
5+
RUN yarn install --frozen-lockfile
6+
7+
COPY . .
8+
9+
RUN yarn build
10+
11+
CMD ["yarn", "start"]

0 commit comments

Comments
 (0)