Giter Site home page Giter Site logo

linear's Introduction

Linear logo

Linear API

The issue tracking tool you'll enjoy using

Linear helps streamline software projects, sprints, tasks, and
bug tracking. It's built for high-performance teams.

Linear is released under the MIT license. Build github action status. Release github action status. Schema github action status. Dependencies github action status.


⚠️ Monorepo Readme

If you are looking for documentation on the Linear SDK or Linear API visit developers.linear.app instead.

The Linear Client uses custom GraphQL Code Generator plugins to produce a typed SDK for all operations and models exposed by the Linear production API.

Structure

This monorepo uses yarn workspaces and lerna to publish packages.

Generated code uses file prefix _generated and should never be manually updated.

Open source packages:

  • sdk - The Linear Client SDK for interacting with the Linear GraphQL API
  • import - Import tooling for uploading from other systems
  • codegen-doc - GraphQL codegen plugin to generate GraphQL fragments and documents
  • codegen-sdk - GraphQL codegen plugin to generate Typescript SDK from fragments and documents
  • codegen-test - GraphQL codegen plugin to generate a jest test for the Typescript SDK

Get Started

# install dependencies
yarn

# link package dependencies
yarn bootstrap

# build all packages
yarn build

# test all packages
yarn test

# update the schema from the production API
yarn schema

# create changeset for generating CHANGELOG.md
yarn changeset

Plugin Flow

  1. The @linear/codegen-doc plugin is used by codegen.doc.yml to generate fragments and documents
  2. The @linear/codegen-sdk plugin is used by codegen.sdk.yml to generate the typed Linear SDK
  3. The @linear/codegen-test plugin is used by codegen.test.yml to generate a typed jest test

License


Licensed under the MIT License.

linear's People

Contributors

artman avatar d2s avatar dependabot[bot] avatar dylans avatar github-actions[bot] avatar guillaumelachaud avatar harisbotic avatar hmnd avatar jergason avatar jorilallo avatar littlemooon avatar maherjaafar avatar mattsacks avatar mihar avatar mikeduister avatar mufeez-amjad avatar nazzrrg avatar pacocoursey avatar pau1fitz avatar rlargman avatar skbogner avatar skovhus avatar smcgivern avatar suevalov avatar tommoor avatar tomskopek avatar zephraph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linear's Issues

Import from GitLab issues CSV

GitLab allows exporting all issues in CSV format. We are eyeing moving from GitLab issues to Linear, so a way to import all of our open issues to Linear would be a great timesaver if we choose to migrate. In fact, the workload that would mean to migrate without an importer is one of the reasons we have not migrated yet.

Is there a plan to support importing GitLab issues automatically from the app or through this CLI importer?

Cannot find module

I tried to use the SDK for a simple CLI tool but got stuck with an internal build error. After following the getting started steps, I got the following error message when building with tsc:

node_modules/@linear/sdk/dist/_generated_documents.d.ts:1:51 - error TS2307: Cannot find module '@graphql-typed-document-node/core' or its corresponding type declarations.

1 import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";

I set up a simple repository with my local setup that hopefully helps to debug the issue.

The GitHub importer duplicates/re-imports issues every time

The CLI interface produces duplicates of issues on import:

image

Notably, the website's importer detects already imported issues and won't import them again:

image

I'd like to run this importer across a few dozen repositories on a regular basis, and duplicating the issues on every import makes that not feasible.

The development history of the importers sort of looks like it is an exported version of the closed source version used by the website. If this is (optimistically) the case, maybe this issue (and #189) would be easy to close?

TypeScript errors when running tsc

Hi, when runningtsc with skipLibCheck: false the compiler runs into these errors:

node_modules/@linear/sdk/dist/graphql-client.d.ts:26:40 - error TS2304: Cannot find name 'RequestInit'.

26     constructor(url: string, options?: RequestInit);
                                          ~~~~~~~~~~~

node_modules/@linear/sdk/dist/graphql-client.d.ts:27:120 - error TS2304: Cannot find name 'RequestInit'.

27     rawRequest<Data, Variables extends Record<string, unknown>>(query: string, variables?: Variables, requestHeaders?: RequestInit["headers"]): Promise<LinearRawResponse<Data>>;
                                                                                                                          ~~~~~~~~~~~

node_modules/@linear/sdk/dist/graphql-client.d.ts:31:135 - error TS2304: Cannot find name 'RequestInit'.

31     request<Data, Variables extends Record<string, unknown>>(document: DocumentNode | string, variables?: Variables, requestHeaders?: RequestInit["headers"]): Promise<Data>;
                                                                                                                                         ~~~~~~~~~~~

node_modules/@linear/sdk/dist/graphql-client.d.ts:32:25 - error TS2304: Cannot find name 'RequestInit'.

32     setHeaders(headers: RequestInit["headers"]): LinearGraphQLClient;
                           ~~~~~~~~~~~

node_modules/@linear/sdk/dist/types.d.ts:4:46 - error TS2304: Cannot find name 'RequestInit'.

4 export interface LinearClientOptions extends RequestInit {
                                               ~~~~~~~~~~~

node_modules/@linear/sdk/dist/types.d.ts:15:52 - error TS2304: Cannot find name 'RequestInit'.

15 export interface LinearClientParsedOptions extends RequestInit {
                                                      ~~~~~~~~~~~

node_modules/@linear/sdk/dist/types.d.ts:28:15 - error TS2304: Cannot find name 'Headers'.

28     headers?: Headers;
                 ~~~~~~~

Issues.filter returning wrong results for `eq` filter

Description

When executing the following GQL query:

query GetIssues{
    issues(
        last: 10,
        orderBy: updatedAt
        filter: {updatedAt: {gt: "2021-06-16T17:05:26.997Z"}}) {
        nodes {
            id
            identifier
            updatedAt
        }
    }
}

Im getting an issue with that exact timestamp:

CleanShot 2021-09-21 at 16 11 46

As one can see its not respecting the semantics of the gt constraint

Greater-than constraint. Matches any values that are greater than the given value.

Note: This is an issue with the underlying server implementation.
And not with this SDK client-generated client, as such, I'm not sure this is the right place to report it, please forward me to the proper place in case this is not it

Can't fetch teams

Whenever I try to fetch teams, I get some server internal errors. Here is my script:

const linearClient = new LinearClient({
  apiKey: process.env.LINEAR_API_TOKEN
})

async function getTeams() {
  const teams = await linearClient.teams()
  console.log(teams)
}

getTeams()

And this is the error I'm getting:

(node:46256) UnhandledPromiseRejectionWarning: Error: An internal server error has occurred.
    at dn (/Users/.../linear-script/node_modules/@linear/sdk/dist/index-cjs.min.js:7:18444)
    at /Users/.../linear-script/node_modules/@linear/sdk/dist/index-cjs.min.js:22:14434
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:46256) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:46256) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

When catching the exception, I get a long error description which hints that something is wrong with the query. The same query works in GarphiQL if that helps debugging.

Am I doing something wrong?

Best way to upload a file as an attachment?

Hi there, I have Typescript node project setup and I'd like to upload a file (like an image or video) as an attachment on an issue. What's the best way to do this?

I'm trying out something like this:

const uploadPayload = await linearClient.fileUpload(file.type, file.name, file.size);

/** Upload the file to the storage URL using the authentication header */
const authHeader = uploadPayload.uploadFile?.headers[0];
const uploadUrl = uploadPayload.uploadFile?.uploadUrl;
if (uploadUrl && authHeader?.key && authHeader?.value) {
  await fetch(uploadUrl, {
    method: "PUT",
    headers: {
      [authHeader?.key]: authHeader?.value,
      "cache-control": "max-age=31536000",
    },
    ...uploadData,
  });

  /** Use the asset URL to attach the stored file */
  const assetUrl = uploadPayload.uploadFile?.assetUrl;
  if (assetUrl) {
    const issuePayload = await linearClient.issueCreate({
      title,
      /** Use the asset URL in a markdown link */
      description: `Attached file: ![${assetUrl}](${encodeURI(assetUrl)})`,
      teamId: "team-id",
    });

    return issuePayload.issue;
  }
}
return undefined;

I can get the uploadPayload object, but the fetch call returns a 403. What do you suggest?

Webhooks result interpretation

Hi,
I'm creating an application using linear webhooks and I want to fetch task's assignee. In order to perform this I found the field "assigneeId" but it's obviously not usable.
Is there a solution to recover user's name with this id? What's the best practice?

Thanks,

Cycle docs say "percentage done" is points not issue count, but may be wrong?

Not sure if this is the right place to report this or not, but I think there's a mismatch between the Linear docs and the app itself.

Specifically on the "Use Cycles" page, in the FAQ, under "What does the percentage mean?", which begins:

The percentage success reflects the percent of estimated work completed in the cycle. The percentage is based on estimations, not the amount of issues. If the estimations are not enabled, each issue counts as 1.

(BTW because of the collapse/expand widgetry there — which seems a bit superfluous to me TBH — I couldn't copy/paste that text directly.)

For completed cycles this may be right, but for my current cycle, it doesn't appear to be. E.g. here's a screenshot of my current cycle:

Screenshot 2022-05-18 at 13 00 53

  • There are 21 issues, of which 4 are done; 4/21 ≈ 19%
  • Total points is 59, of which done issues account for 10 points; 10/59 = 0.169 ≈ 17%

So it looks to me like the estimate percentage done is 17% not 19%, but 19% is shown. (The "All cycles" view also shows this, as "19% progress".)

As I missing/misunderstanding something, or are the docs wrong? (Or is the app wrong?)

Many thanks!

yarn build fails on node 17.1.0

Error message is Error: error:0308010C:digital envelope routines::unsupported

❯ yarn build      
yarn run v1.22.10
$ run-s generate build:sdk generate:test build:import build:types docs
$ run-s generate:clean generate:doc generate:sdk
$ lerna run generate:clean
lerna notice cli v3.22.1
lerna info Executing command in 1 package: "yarn run generate:clean"
lerna info run Ran npm script 'generate:clean' in '@linear/sdk' in 0.5s:
$ npx rimraf src/**/_generated*
lerna success run Ran npm script 'generate:clean' in 1 package in 0.5s:
lerna success - @linear/sdk
$ lerna run build:codegen-doc && lerna run generate:doc
lerna notice cli v3.22.1
lerna info Executing command in 1 package: "yarn run build:codegen-doc"
lerna ERR! yarn run build:codegen-doc exited 1 in '@linear/codegen-doc'
lerna ERR! yarn run build:codegen-doc stdout:
$ run-s build:clean build:rollup
$ npx rimraf dist
$ npx rollup -c

Computed sizes of "dist/index-cjs.min.js" with "cjs" format
  bundler parsing size: 39,209 B
  browser parsing size (minified with terser): 17,912 B
  download size (minified and gzipped): 5,091 B

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build:codegen-doc stderr:

src/index.ts → ./, ./...
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/home/bbeecher/workspace/linear/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/bbeecher/workspace/linear/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/bbeecher/workspace/linear/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/bbeecher/workspace/linear/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/bbeecher/workspace/linear/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/bbeecher/workspace/linear/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/bbeecher/workspace/linear/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at /home/bbeecher/workspace/linear/node_modules/loader-runner/lib/LoaderRunner.js:205:4
    at Immediate.<anonymous> (/home/bbeecher/workspace/linear/node_modules/memory-fs/lib/MemoryFileSystem.js:330:4)
    at processImmediate (node:internal/timers:464:21)
error Command failed with exit code 1.
ERROR: "build:rollup" exited with 1.
error Command failed with exit code 1.

lerna ERR! yarn run build:codegen-doc exited 1 in '@linear/codegen-doc'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "generate:doc" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "generate" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Worked around by using current LTS

[bug] (@linear/sdk) get project() in Issue returns 400

Hi, we have a script running and up until recently it was working fine with this code:

const issueSearch = await linear.issueSearch(issueCode);
const issue = issueSearch?.nodes?.[0];
// ...
const projectName = (await issue.project)?.name;

But now await issue.project returns 400:

T [Error]: Variable "$id" of type "String!" used in position expecting type "UUID!".
 {
  type: 'GraphqlError',
  errors: [
    p {
      type: 'GraphqlError',
      userError: false,
      path: undefined,
      message: 'Variable "$id" of type "String!" used in position expecting type "UUID!".'
    }
  ],
  query: 'query project($id: String!) {\n' +
    '  project(id: $id) {\n' +
    '    ...Project\n' +
    '  }\n' +
    '}\n' +
    '\n' +
    'fragment Project on Project {\n' +
    '  targetDate\n' +
    '  icon\n' +
    '  updatedAt\n' +
    '  milestone {\n' +
    '    id\n' +
    '  }\n' +
    '  completedScopeHistory\n' +
    '  completedIssueCountHistory\n' +
    '  lead {\n' +
    '    id\n' +
    '  }\n' +
    '  color\n' +
    '  description\n' +
    '  name\n' +
    '  slugId\n' +
    '  sortOrder\n' +
    '  archivedAt\n' +
    '  createdAt\n' +
    '  canceledAt\n' +
    '  completedAt\n' +
    '  startedAt\n' +
    '  scopeHistory\n' +
    '  issueCountHistory\n' +
    '  state\n' +
    '  id\n' +
    '  creator {\n' +
    '    id\n' +
    '  }\n' +
    '  slackIssueComments\n' +
    '  slackNewIssue\n' +
    '  slackIssueStatuses\n' +
    '}\n',
  variables: { id: 'c4abe44a-8391-44d8-8c79-d9daf7964fc8' },
  status: 400,
  data: undefined,

Mapping Status to list when importing from Trello

I imported my cards as issues to Linear from Trello, but they all end up having status "Backlog"
is there any way to map Trello list (lane) to the issue status?

I have it rather straightforward is that there is almost 1-to-1 matching

Screenshot 2022-06-16 at 2 16 30 PM

ASANA - Import feature request: Levels

The current importer only takes tasks at their top level, meaning if those issues have subtasks, or subtask-subtasks, etc they're ignored :(

**Assuming that level is the terminology based on an Asana .csv export.

Make imports idempotent

Currently, if the Linear API returns a 500/503, there's a connection error, etc. the import halts midway through.

Unfortunately, this is a significant inconvenience when importing multiple Github repos to a single team (it probably is less painful for other CSV-based importers).

It'd be very nice to have the importer:

  • First load existing issues for a given team from Linear
  • Check if an issue has already been imported
  • Import only if it has not

This could probably be accomplished by simply looking for the string the importer injects into the issue body, e.g., [View original issue in GitHub](URL).

What's the correct way to change sortOrder?

Hi! We built an app that integrates with linear, inside we import user's org roadmap/projects, we would like to allow the user to change the order of the project directly from our app instead of having to go to Linear, so I'm trying to figure out how does the sortOrder field works, I can see it is a float, but what is the logic behind it?

if I want to move a project (p1) above another one (p2) I could just do sortOrder - 1 (p1.sortOrder = p2.sortOrder -1) but I guess that will come back and bite me in the ass at some point

Any pointers would be really appreciated

Ability to run the CLI import in non-interactive mode

During setup, we run the CLI import tool a lot, and it's very long to answer all questions. There should be a non-interactive mode with CLI arguments, as well as the ability to provide the API key through an environment variable.

lin checkout fails

Hey all - I'm guessing lin is no longer supported given it's absence from this repo and your docs, but it makes a lot of sense to have a cli tool that can checkout a branch for my in progress issue. Curious if you have plans to keep it up?

Currently lin checkout, after I've pasted in my API token on the first run, fails with the following error message:

Authentication required - You need to authenticate to access this operation.

Any help is appreciated.

[SDK] Getting a GraphQL error when trying to retrieve history for an issue

Hi 👋

Thanks for building an awesome issue tracking tool!

I've been playing around with the Linear SDK with the purpose of creating a custom stand-up/daily tool for my team. While doing this, I bumped into a challenge when trying to retrieve the history for an issue.

A bit of a contrived example here:

const issue = await client.issue("some-issue-id")
const history = await issue.history()

This gives me the error:

'Field "relationChanges" of type "[IssueRelationHistoryPayload!]" must have a selection of subfields. Did you mean "relationChanges { ... }"?'

I don't get the error for similar queries, e.g.

const labels = await issue.labels() // works just fine

Is this a bug? Or am I just doing something wrong?

💁 Note, I'm pretty new to both the SDK and GraphQL

Complete stack trace:

Ti [Error]: Field "relationChanges" of type "[IssueRelationHistoryPayload!]" must have a selection of subfields. Did you mean "relationChanges { ... }"?: {"response":{"errors":[{"message":"Field \"relationChanges\" of type \"[IssueRelationHistoryPayload!]\" must have a selection of subfields. Did you mean \"relationChanges { ... }\"?","locations":[{"line":26,"column":3}],"extensions":{"type":"graphql error","userError":false}}],"status":400,"headers":{}},"request":{"query":"query issue_history($id: String!, $after: String, $before: String, $first: Int, $includeArchived: Boolean, $last: Int, $orderBy: PaginationOrderBy) {
      issue(id: $id) {
        history(
          after: $after
      before: $before
      first: $first
      includeArchived: $includeArchived
      last: $last
      orderBy: $orderBy
    ) {
          ...IssueHistoryConnection
    }
  }
}

fragment IssueHistoryConnection on IssueHistoryConnection {
      nodes {
        ...IssueHistory
  }
  pageInfo {
        ...PageInfo
  }
}

fragment IssueHistory on IssueHistory {
      relationChanges
  addedLabelIds
  removedLabelIds
  source
  issue {
        id
  }
  updatedAt
  toCycle {
        id
  }
  toParent {
        id
  }
  toProject {
        id
  }
  toState {
        id
  }
  fromCycle {
        id
  }
  fromParent {
        id
  }
  fromProject {
        id
  }
  fromState {
        id
  }
  fromTeam {
        id
  }
  toTeam {
        id
  }
  archivedAt
  createdAt
  id
  fromAssignee {
        id
  }
  toAssignee {
        id
  }
  actor {
        id
  }
  fromDueDate
  toDueDate
  fromEstimate
  toEstimate
  fromPriority
  toPriority
  fromTitle
  toTitle
  archived
  updatedDescription
  autoArchived
  autoClosed
}

fragment PageInfo on PageInfo {
      startCursor
  endCursor
  hasPreviousPage
  hasNextPage
}
","variables":{"id":"ISSUE_ID_WAS_HERE"}}}
      at Ii.<anonymous> (/Users/christian/code/linear-stand-up/node_modules/@linear/sdk/dist/index-cjs.min.js:17:28196)
      at Generator.next (<anonymous>)
      at l (/Users/christian/code/linear-stand-up/node_modules/@linear/sdk/dist/index-cjs.min.js:16:416)
      at runMicrotasks (<anonymous>)

Malformed repo names produces a misleading error in the GitHub importer

Assume a GitHub organization named foo which owns a repository named bar.

Entering a malformed repo name like bar, instead of the full foo/bar like this:

? From which repo do you want to import issues from (e.g. "facebook/react") bar

produces an infinite stream of the following error:

Error: Unable to find repo bar/undefined. Did you select `repo` scope for your GitHub token?
    at GithubImporter.<anonymous> (/nix/store/y9r60ar88lwq6a21q0ff7qnvl4ch0gb2-linear-import/share/importer/dist/cli.js:409:31)
    at Generator.next (<anonymous>)
    at fulfilled (/nix/store/y9r60ar88lwq6a21q0ff7qnvl4ch0gb2-linear-import/share/importer/dist/cli.js:69:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

I did grant the repo scope. It strikes me that the import tool could detect that the string I entered was parsed as the org name and that the repo name is undefined, and produce a nicer error.

Weird app icon on Windows

On Windows 11, Linear uses a Big Sur icon, which is Apple's style, not Windows'. Also, the icon is very small compared to other app icons on the taskbar.

image

Better CLI argument handling

Would be nice if the ability was added to pass in tokens via flags. EG:

linear-import -t xxxxxx --github-token xxxxxx

Just a nice QoL improvement when setting up a new workspace and importing multiple repositories issues having to manually copy paste in tokens manually each time 🙂

Query error on using client.team fetch method

I'm seeing the below error but was working as expected before. Not sure if I'm missing something here.

UnhandledPromiseRejectionWarning: Error: Cannot query field "defaultTemplateForMembersId" on type "Team". Did you mean "defaultTemplateForMembers" or "defaultTemplateForNonMembers"?
at q (/Users/aga5tya/Sites/linear-changelog-generator/node_modules/@linear/sdk/dist/index-cjs.min.js:16:5568)
    at /Users/aga5tya/Sites/linear-changelog-generator/node_modules/@linear/sdk/dist/index-cjs.min.js:17:603899

Code reference:

import SDK from '@linear/sdk'

const { LinearClient } = SDK

const linearClient = new LinearClient({
    apiKey: process.env.LINEAR_TOKEN,
})
const team = await linearClient.team("<*OurTeamID*>")

Updated to the latest package, but still seem to have the error.

Linear CSV to Linear getting INTERNAL_SERVER_ERROR

Hey team! Not sure how could I the console log because it doesn't say much other than createIssue GQL returned with INTERNAL_SERVER_ERROR.

Maybe your error tracking traced this?

image

Node version: 14 and 16

Command not found after install

Getting command not found after running yarn global add @linear/import and then running linear-import. I have opened a new terminal and tried again with no luck. I have confirmed by running yarn list that it is present as a package.

Asana custom fields are not preserved in any way

It seems that Linear doesn't have custom fields like Asana, but on import from Asana it could at least:

  • Offer the option of using labels to replace label-like (dropdown) custom fields
  • Append other custom fields and values as text within the issue description, so that they are visible and searchable in an unstructured way, even if not cleanly filterable.

Import feature request: ClickUp

I love the software and follow its progress but I can't hope to ever switch until an importer is available for ClickUp.

I'd be fine with lists and folders being converted to tags or anything else that allows me to re-create the structure in Linear.

publish the packages: codegen-doc, codegen-sdk and codegen-test on npm as well

hello guys,
we are very happy customers of linear. Thank you for the great work you do. That's how I stumbled across your documentation and this repo. Well, we also use graphql for our product. I think your approach to generating the SDK is very clever. I would like to use a part of the package that you have written here for our product. I am mainly interested in @linear/codegen-doc. Legally, it is no problem with a MIT licence. But it's a bit cumbersome to copy your code or to fork the whole repo (especially if only one package from the monorepo here is reused). Therefore, it would be great if you could publish the packages: codegen-doc, codegen-sdk and codegen-test on npm as well.

Thanks much!
Moritz

Export/Import tickets between workspaces

There is no an option to import tickets into workspace, created already in different workspace. I've tried to use Pivotal Tracker CSV importer but it failed with the next error (see below). It says priority: 8, but it is not priority, it's estimation based on exported CSV from Linear.app. So it would be great if I can move tickets from one workspace to another any possible way.

Error occurred while importing:

{
  "errors": [
    {
      "message": "Invalid input: Priority cannot be higher than 4.",
      "path": [
        "issueCreate"
      ],
      "locations": [
        {
          "line": 12,
          "column": 13
        }
      ],
      "extensions": {
        "type": "invalid input",
        "userError": true,
        "userPresentableMessage": "Invalid input: Priority cannot be higher than 4.",
        "fieldErrors": {
          "priority": [
            "Priority cannot be higher than 4."
          ]
        }
      }
    }
  ],
  "data": null
}
Error: Invalid input: Priority cannot be higher than 4.: {"response":{"errors":[{"message":"Invalid input: Priority cannot be higher than 4.","path":["issueCreate"],"locations":[{"line":12,"column":13}],"extensions":{"type":"invalid input","userError":true,"userPresentableMessage":"Invalid input: Priority cannot be higher than 4.","fieldErrors":{"priority":["Priority cannot be higher than 4."]}}}],"data":null,"status":200},"request":{"query":"\n          mutation createIssue(\n              $teamId: String!,\n              $projectId: String,\n              $title: String!,\n              $description: String,\n              $priority: Int,\n              $labelIds: [String!]\n              $stateId: String\n              $assigneeId: String\n            ) {\n            issueCreate(input: {\n                                teamId: $teamId,\n                                projectId: $projectId,\n                                title: $title,\n                                description: $description,\n                                priority: $priority,\n                                labelIds: $labelIds\n                                stateId: $stateId\n                                assigneeId: $assigneeId\n                              }) {\n              success\n            }\n          }\n        ","variables":{"teamId":"3d3e02ed-e46c-422a-a4bf-a070e9161b49","title":"sub issue 2","priority":8,"labelIds":[],"stateId":"d961b109-e902-46c7-be77-fe45c05103ae"}}}
    at GraphQLClient.<anonymous> (/Users/anotheri/Development/linear-import/src/client/index.ts:59:13)
    at step (/Users/anotheri/Development/linear-import/node_modules/tslib/tslib.js:136:27)
    at Object.next (/Users/anotheri/Development/linear-import/node_modules/tslib/tslib.js:117:57)
    at fulfilled (/Users/anotheri/Development/linear-import/node_modules/tslib/tslib.js:107:62)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  response: { errors: [ [Object] ], data: null, status: 200 },
  request: {
    query: '\n' +
      '          mutation createIssue(\n' +
      '              $teamId: String!,\n' +
      '              $projectId: String,\n' +
      '              $title: String!,\n' +
      '              $description: String,\n' +
      '              $priority: Int,\n' +
      '              $labelIds: [String!]\n' +
      '              $stateId: String\n' +
      '              $assigneeId: String\n' +
      '            ) {\n' +
      '            issueCreate(input: {\n' +
      '                                teamId: $teamId,\n' +
      '                                projectId: $projectId,\n' +
      '                                title: $title,\n' +
      '                                description: $description,\n' +
      '                                priority: $priority,\n' +
      '                                labelIds: $labelIds\n' +
      '                                stateId: $stateId\n' +
      '                                assigneeId: $assigneeId\n' +
      '                              }) {\n' +
      '              success\n' +
      '            }\n' +
      '          }\n' +
      '        ',
    variables: {
      teamId: '3d3e02ed-e46c-422a-a4bf-a070e9161b49',
      projectId: undefined,
      title: 'sub issue 2',
      description: undefined,
      priority: 8,
      labelIds: [],
      stateId: 'd961b109-e902-46c7-be77-fe45c05103ae',
      assigneeId: undefined
    }
  }
}

The GitHub importer can't match owners like the website can

The GitHub importer asks to assign all of the issues to one person or nobody. In comparison, the website's importer supports mapping issues to people in the team. I'd like to run this importer across a few dozen repositories on a regular basis, which makes this tricky.

[GitHub] "Duplicate label name - Label with this name already exists in the team"

Steps

  1. Create a GitHub repo with some issues and some labels.
  2. Assign some labels to each issue.
  3. Run linear-import and import those issues to a team.
  4. On GitHub, close all of the open issues.
  5. Create a new set of issues and assign some of the same labels.
  6. Run linear-import again and try to import the new issues to the same team.

Expected behavior

  • Imported issues should reuse previously imported labels.

Observed behavior

  • Import fails due to "label already exists"
...
[Error]: Duplicate label name - Label with this name already exists in the team
    at q (/Users/ryan/.config/yarn/global/node_modules/@linear/sdk/dist/index-cjs.min.js:16:5568)
    at /Users/ryan/.config/yarn/global/node_modules/@linear/sdk/dist/index-cjs.min.js:17:603899
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  type: 'InvalidInput',
  errors: [
    p {
      type: 'InvalidInput',
      userError: true,
      path: [Array],
      message: 'Label with this name already exists in the team'
    }
  ],
...

Alternate acceptable resolution

  • Add a command-line flag or prompt allowing the user to ignore labels (i.e., import only issue title and description).

INTERNAL_SERVER_ERROR on issueUpdate

Mutation -

mutation IssueUpdate($id: String!, $stateId: String!) {
  issueUpdate(
    id: $id,
    input: {
      stateId: $stateId,
    }
  ) {
    success
  }
}

Response -

[
  {
    message: 'Internal server error',
    path: [ 'issueUpdate' ],
    locations: [ [Object] ],
    extensions: {
      code: 'INTERNAL_SERVER_ERROR',
      type: 'internal error',
      userError: false
    }
  }
]

Tried using @linear/sdk, tried it with raw query. Same result.

I created 2 workspaces and it seems that this error only happens on one of them.

Support for subscriptions

We're currently planning on integrating to linear as one of the services we support at GitStart, and we're curious if the API support subscription. If it doesn't, is that currently in the roadmap

Feature Request - Add notion integration

I use notion for some projects and would love to get those ported to Linear as soon as possible. Notion has ways of exporting table data into a .csv format, so on a surface-level adding an integration for that looks straightforward.

Error: Could not find anonymous context param for mutation issuePriorityValues

Hi,

I'm currently getting the following error:

Error: Could not find anonymous context param for mutation issuePriorityValues

I haven't changed anything in my code but it appears to have broken somehow, as it originally worked fine. Could this be a data issue perhaps or has there been a change to the API?

My code looks as follows:

import { LinearClient } from '@linear/sdk';
...
this.linear = new LinearClient({ apiKey: process.env.LINEAR_KEY });
...
const priorities = await this.linear.issuePriorityValues;

Thanks in advance for looking into it !


Version of SDK: 1.22.0
Node version: v14.19.3

Labels in Linear belong to a Team however trough the API one can create issues with label id from other teams

Description

As indicated in the title I have found out that one can use the API to create issues providing id's for labels that do not belong to the Team the issue belongs to

linearClient.issueCreate({
        teamId: reqBody.teamId,
        title: reqBody.title,
        labelIds: [
          'ac1890e9-2b30-47ca-92f9-8da5c8d0dce7',
          'abee022c-2fed-4d0d-b739-2c8aed9cdce9',
          '2e49da12-b735-4637-a1ca-f471338921aa',
          'd686d683-d386-4d56-814d-1ab6716cbea9',
          '811f20af-ed11-48ec-a8c9-0bac825d1fd9',
          'b087fb1c-753f-4529-a480-a6a728840885',
          'beea4cfa-150e-412b-a187-bfba425f9f11',
        ],
        description: reqBody.description,
      })

CleanShot 2021-10-06 at 16 37 14

missing API for deleting labels

Currently, the SDK only allows for label archival via issueLabelArchive(), but no permanent removal. The problem with archival is that you currently 1) can't unarchive a label 2) can't create a new label with the same name.

The problem (2) apparently isn't even handled, as creating a label with a name of a duplicate, archived label results in an Internal server error in the SDK, and this error in the UI:

image

Proposal:

  • expose issueLabelDelete() on the SDK
  • support un-archiving a label via the SDK (if there's even a good reason for supporting archival in the first place)

I encountered this issue when writing a custom importer. This label issue makes it slightly more complicated.

Estimates is missing in generated sdk

Hello, I am big fan of your product, really appreciate how well structured it is.
Was looking for estimates feature in sdk seems that it is not there.
Any plans to add it to sdk?

Update SDK code to use Connections instead of Raw models

Apparently the Linear API has moved from raw objects to Connections objects for pagination, so the examples shown in the documentation were not working anymore.

The examples are updated to use the Connections approach passing edges and node fields in the GraphQL queries.

See #4

[FEATURE] Sync a board with a github project board

Hi,

I'm not sure this is the right repo to open an issue on, but if it's not, please show me how I can make a feature request / suggestion.

Allright, I've been using Github project boards and I was wondering if there was any way to synchronize these with boards on Linear.

I'd probably want to use my existing Github boards as they currently are and slowly gradually move my stuff to Linear and make a more "complete" use of the app (when creating new boards for instance).

I feel like this would be a really nice touch, specially for a developper focused tool that already offers some level of integration with Github.

Keep in mind that most developpers don't get to choose which "issue tracking / project management" tool they use and this would be a really nice selling points for dev to adopt Linear.

Anyway, let me know if this is currently doable with the app as it is or if its a feature you plan on adding anytime soon.

François

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.