Files
wekan/models/githubImportJobs.js
T
Lauri Ojansivu 935e68dfdd GitHub organization import: repositories, issues, releases, Actions, wiki.
Import -> GitHub -> Import a whole GitHub organization makes every
repository of an organization or user its own board, opening in Board View
/ Version Control. Issues go through the ordinary importBoard, as the person
who started the job, with their comments, labels and files. Releases are
cards in a Releases list, their files attached only when chosen. Each
.github/workflows file becomes Rules. The wiki is read from its git
repository with isomorphic-git (1.42.4, pinned), every request through the
SSRF guard and only to github.com: a page is a card in the Wiki list, its
[[links]] point at and are attached to the linked pages' cards, and each
commit that changed it is a dated edit in the card's history, so Restore
brings back an older version. The job shows progress, can be cancelled,
pauses on a restart and stops at a rate limit; the token is kept in memory
only.

Version Control gains Releases and Wiki tabs: the wiki as GitHub shows it,
with the page list, _Sidebar and _Footer, links that stay in the tab, and
each page's history with Restore.

GitHub Actions workflows map to Rules: issue events to triggers, label,
close, reopen, comment, assign and create steps to actions, actions/stale to
an aging rule. Code - builds, tests, scripts - is never run: such a workflow
is a disabled rule with its YAML as the description. WeKan's Rules gain what
they lacked for it: a "commented on" trigger, an "add comment" action written
as the person whose change ran the rule and only where they may comment,
cron schedules in UTC, and a rule description shown on the rule. A disabled
rule no longer fires on a schedule or from its button, which it did.

The new strings are translated in every locale.

Thanks to xet7 !
2026-10-14 12:43:36 +03:00

22 lines
949 B
JavaScript

import { Mongo } from 'meteor/mongo';
// Background GitHub organization imports (server/githubOrgImport.js): every
// repository of an organization or user as a board, with its issues,
// releases, Actions workflows as Rules and its wiki. Like the Trello import's
// jobs, the document holds the queue, progress, per-repository results and
// an error log, so the import page can show progress after navigating away.
//
// SECURITY: the GitHub token is NEVER stored here. It is kept only in server
// memory for the running loop; a job interrupted by a restart is paused and
// is started again with the token.
//
// No SimpleSchema on purpose: internal bookkeeping, written only by the
// server and published only to its owner.
const GithubImportJobs = new Mongo.Collection('github_import_jobs');
if (Meteor.isServer) {
GithubImportJobs.deny({ insert: () => true, update: () => true, remove: () => true });
}
export default GithubImportJobs;