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

Label sync fail but appears as success #129

Open
iteles opened this issue Aug 13, 2022 · 3 comments
Open

Label sync fail but appears as success #129

iteles opened this issue Aug 13, 2022 · 3 comments
Assignees
Labels
bug Suspected or confirmed bug (defect) in the code chore a tedious but necessary task often paying technical debt feedback Feedback from people using the App or any other repo please-test Please test the feature in Staging Environment and confirm it's working as expected. technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@iteles
Copy link
Member

iteles commented Aug 13, 2022

I've just tried to sync the labels with https://github.com/mosteirodelandim/landim-website/issues/labels and got the 'label sync successful!' message, but in actual fact, the labels remained the same.

When I tried to sync again by inputting the org and repo into the app, I got the following extra dialogue (new success message and second set of boxes):
image

Clicking re-sync also yielded no results.

@iteles iteles added the bug Suspected or confirmed bug (defect) in the code label Aug 13, 2022
@nelsonic nelsonic added this to To do in Simon's list via automation Aug 13, 2022
@nelsonic nelsonic added technical A technical issue that requires understanding of the code, infrastructure or dependencies chore a tedious but necessary task often paying technical debt feedback Feedback from people using the App or any other repo labels Aug 13, 2022
@nelsonic
Copy link
Member

Bug confirmed. Don't have access to the Fly App to debug (on this computer ...) so will have to be later/Monday. 💭

@SimonLab
Copy link
Member

Thanks @iteles for reporting this bug.
I think it's a permission issue which is wrongly reported as correct why the labels are copied.
I'll add more checks and send back an error message for this case.

@SimonLab SimonLab self-assigned this Aug 15, 2022
@SimonLab SimonLab moved this from To do to In progress in Simon's list Aug 15, 2022
@SimonLab
Copy link
Member

Updating the following function to make sure all the api request to Github return without any errors:

defp create_or_update_labels(token, owner, repo, source_labels, target_labels) do
target_label_names = Enum.map(target_labels, & &1["name"])
source_labels
|> Enum.map(fn label ->
if Enum.member?(target_label_names, label["name"]) do
updated_label = Map.put(label, :new_name, label["name"])
Task.async(github_api(), :update_label, [token, owner, repo, label["name"], updated_label])
else
Task.async(github_api(), :create_label, [token, owner, repo, label])
end
end)
|> Enum.map(fn task -> Task.await(task) end)
:ok
end

  • Make sure the function returns :ok or :error atom

@SimonLab SimonLab moved this from In progress to Awaiting Feedback/Review in Simon's list Aug 22, 2022
@SimonLab SimonLab added the awaiting-review An issue or pull request that needs to be reviewed label Aug 22, 2022
@SimonLab SimonLab added please-test Please test the feature in Staging Environment and confirm it's working as expected. and removed awaiting-review An issue or pull request that needs to be reviewed labels Sep 14, 2022
@SimonLab SimonLab removed their assignment Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Suspected or confirmed bug (defect) in the code chore a tedious but necessary task often paying technical debt feedback Feedback from people using the App or any other repo please-test Please test the feature in Staging Environment and confirm it's working as expected. technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
Simon's list
Awaiting Feedback/Review
Development

No branches or pull requests

3 participants