Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create linear issue branch #1

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Create linear issue branch #1

wants to merge 10 commits into from

Conversation

hxghhhh
Copy link
Owner

@hxghhhh hxghhhh commented May 3, 2020

Allow users to pull all the task branch names associated with them. This is strictly a POC will continue build out the proper flow.

pylinear-create-branch

Todo:

  • Create command for creating all branches
  • Add pre-commit
  • Add precommit black format
  • Add option to push branch (--connect)
  • Remove token and pull it from ENV
  • mypy w/ typing

@hxghhhh
Copy link
Owner Author

hxghhhh commented May 9, 2020

Quick update:

Users are now able to choose a specific issue, and then sync via gh package

@hxghhhh hxghhhh changed the title Generate all linear branches Create linear issue branch May 9, 2020
Copy link

@joelrojo joelrojo left a comment

Choose a reason for hiding this comment

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

@hxghhhh Looking good so far man, added some quick comments!

for _ in range(count):
click.echo(f"Hello, {name}!")

# reference: https://click.palletsprojects.com/en/7.x/quickstart/#echoing
Copy link

Choose a reason for hiding this comment

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

maybe add one line here on what the reference helps with or the context?

use_json=True,
headers={
"Content-type": "application/json",
"Authorization": "V4HEChjkzfY0kCWIQolWmiY2XS220M2FhCU1NFzm",
Copy link

Choose a reason for hiding this comment

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

Is it cool to expose the auth token like this? Not sure if it's specific to you or not, but if it is might want to put this in env file or something. But probably a v2 thing to add auth and store it

retries=3, transport=sample_transport, fetch_schema_from_transport=True
)

query = gql(
Copy link

Choose a reason for hiding this comment

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

this looks dope, can't wait to dive into graphql more


# Build issueIdentifier
issues = []
for issue in data.get("viewer").get("assignedIssues").get("nodes"):
Copy link

Choose a reason for hiding this comment

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

Not sure if .get throws an error if the key doesn't exist in Python, but might want to handle this in case the data returns an error or invalid response

Copy link
Owner Author

Choose a reason for hiding this comment

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

.get with return None in any case so the functional statement in the foor loop won't execute

linear.py Outdated
os.system(f"gh pr create {issue_selected}")


# Build issueTitle
Copy link

Choose a reason for hiding this comment

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

remove commented code (unless it's for future features)

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

Successfully merging this pull request may close these issues.

2 participants