Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

feat: add full sync for pr #1

Merged
merged 13 commits into from
Jan 14, 2021
Merged

feat: add full sync for pr #1

merged 13 commits into from
Jan 14, 2021

Conversation

Mini256
Copy link
Member

@Mini256 Mini256 commented Jan 11, 2021

  • add full sync for pr on app startup
  • dealing with the problem that emoji expression can't be saved
  • ignore PR not updated
  • add full sync for pr on the app when install on repo
  • add test for syncPullRequest method
  • fetch sync repo config from installation
  • fetch sync repo config from env file (only for test)
  • feat: add test for getSyncRepositoryListFromEnv
  • add doc
  • translate the doc

@todo
Copy link

todo bot commented Jan 11, 2021

patch the relation field.

// TODO: patch the relation field.
pullInDB.relation =
pull.author_association === "MEMBER" ? "member" : "not member";
pullInDB.owner = owner;
pullInDB.repo = repo;


This comment was generated by todo based on a TODO comment in f30b1be in #1. cc @ti-community-infra.

@Mini256 Mini256 changed the title feat: add full sync for pr WIP: feat: add full sync for pr Jan 11, 2021
@Mini256 Mini256 changed the title WIP: feat: add full sync for pr feat: add full sync for pr Jan 12, 2021
@ti-community-infra ti-community-infra deleted a comment from todo bot Jan 12, 2021
@ti-community-infra ti-community-infra deleted a comment from todo bot Jan 12, 2021
@todo
Copy link

todo bot commented Jan 12, 2021

Refactor the LaterThan function.

// TODO: Refactor the LaterThan function.
// timeALaterThanTimeB is used to determine that whether time A later than time B.
export function timeALaterThanTimeB(timeAStr: string, timeBStr: string) {
const timeA = timeAStr !== undefined ? Number(Date.parse(timeAStr)) : 0;
const timeB = timeBStr !== undefined ? Number(Date.parse(timeBStr)) : 0;


This comment was generated by todo based on a TODO comment in 7b13b3b in #1. cc @ti-community-infra.

@Mini256
Copy link
Member Author

Mini256 commented Jan 12, 2021

@hi-rustin Cloud you please take a look?

@hi-rustin
Copy link
Contributor

I will review it tomorrow.

@Mini256
Copy link
Member Author

Mini256 commented Jan 12, 2021

I will review it tomorrow.

OK, thanks.

src/common/global.ts Outdated Show resolved Hide resolved
src/events/app/index.ts Outdated Show resolved Hide resolved
src/events/app/index.ts Outdated Show resolved Hide resolved
src/events/app/index.ts Outdated Show resolved Hide resolved
src/events/app/index.ts Outdated Show resolved Hide resolved
src/events/app/index.ts Outdated Show resolved Hide resolved
src/events/app/index.ts Outdated Show resolved Hide resolved
src/queries/SyncPullQuery.ts Show resolved Hide resolved
src/services/PullService.ts Outdated Show resolved Hide resolved
src/utils/parser.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@f76b141). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main       #1   +/-   ##
=======================================
  Coverage        ?   87.95%           
=======================================
  Files           ?        5           
  Lines           ?       83           
  Branches        ?        8           
=======================================
  Hits            ?       73           
  Misses          ?        9           
  Partials        ?        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f76b141...457381c. Read the comment docs.

test/index.test.ts Show resolved Hide resolved
test/utils/util.test.ts Show resolved Hide resolved
test/utils/util.test.ts Outdated Show resolved Hide resolved
test/services/PullService.test.ts Outdated Show resolved Hide resolved
test/events/app/index.test.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
src/events/app/index.ts Outdated Show resolved Hide resolved
src/events/app/index.ts Show resolved Hide resolved
@hi-rustin
Copy link
Contributor

By the way, I think the PR is a bit too big, maybe it's best to keep it to 300-400 lines.

src/events/app/index.ts Outdated Show resolved Hide resolved
@todo
Copy link

todo bot commented Jan 14, 2021

use the github client authed by installation id.

ti-sync-bot/src/index.ts

Lines 19 to 24 in 6df27e3

// TODO: use the github client authed by installation id.
// Init Github client.
// Notice: This github client uses a TOKEN as the bot github account for access, in this case, we do not need to
// authorize for each installation through the Github APP, but this will also bring some restrictions.
const github = new ProbotOctokit({
auth: {


This comment was generated by todo based on a TODO comment in 6df27e3 in #1. cc @ti-community-infra.

@todo
Copy link

todo bot commented Jan 14, 2021

Clean up the unused code temporarily left here.

// TODO: Clean up the unused code temporarily left here.
describe("Ti Sync Bot", () => {
// let probot: any;
beforeAll(() => {
useContainer(Container);


This comment was generated by todo based on a TODO comment in 6df27e3 in #1. cc @ti-community-infra.

src/events/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the unexported function, reset LGTM.

@Mini256
Copy link
Member Author

Mini256 commented Jan 14, 2021

Tested the unexported function, reset LGTM.

Add todo issue for startup event test: #4

@Mini256
Copy link
Member Author

Mini256 commented Jan 30, 2021

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants