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

<test> #54

Open
blackcodeking912 opened this issue Aug 18, 2023 · 1 comment
Open

<test> #54

blackcodeking912 opened this issue Aug 18, 2023 · 1 comment

Comments

@blackcodeking912
Copy link
Contributor

No description provided.

@abanna
Copy link
Contributor

abanna commented Aug 18, 2023

@main.command('sync', help="Entrypoint for github actions integration")
@click.option(
"-i",
"--ado-id",
help="ADO item id. int need to be passed via the cmd line",
default=os.getcwd(),
required=True,

)
@click.option(
"-s",
"--item-state",
help="state of the thing",
default=os.getcwd(),
required=True,

)
@click.pass_context
def sync_boards(ctx, ado_id: int, item_state: str):
from odious_ado.plugins import gh
# the experctation is that we are getting passed a id + + state
ctx.ensure_object(dict)

settings = BaseConfig.get_settings()
ctx.ensure_object(dict)
ctx.obj['client']: Github = Github(settings.GITHUB_ACCESS_TOKEN)


settings = BaseConfig.get_settings()
gh_org, repo = settings.GITHUB_REPOSITORY.split('/')
gh_issue_ids = gh.get_i_issue_ids(organization=gh_org, repository_name=repo)
project_id = gh.list_projects(ctx.obj['client'])
issues = gh.get_issues(ctx.obj['client'])
from odious_ado.plugins.ado.state import set_ADO_state, get_ADO_state



for dnd in gh_issue_ids:
    db_id, pvti = gh.add_issue_to_project(append_label=True, project_id=project_id, content_id=dnd)
    for i in issues:
        # 921938
        i.add_to_labels(pvti)
        new_ado_id = set_ADO_state(ado_id, item_state)
        i.add_to_labels(f"ADO-{new_ado_id}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants