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

Fix JSON parsing in koji.js #828

Closed
wants to merge 1 commit into from
Closed

Conversation

Fabio1988
Copy link
Contributor

@Fabio1988 Fabio1988 commented Mar 21, 2023

Description

It can happen that JSON files have a special encoding character at the beginning, this check would prevent loading the json. we already use try/catch here

Motivation and Context

I want to use Koji with Poracle (both in docker)
fixes #827

How Has This Been Tested?

Bearer token is now detected after that change

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

It can happen that JSON files have a special encoding character at the beginning, this check would prevent loading the json. we already use try/catch here
@jfberry
Copy link
Collaborator

jfberry commented Mar 21, 2023

Really this shouldn't be happening here at all but rather in the load geofence where proper config loader has already been called

@Fabio1988
Copy link
Contributor Author

Then the workflow has to be completly changed, true?

So you mean we should not load the config json in that place

@jfberry
Copy link
Collaborator

jfberry commented Mar 21, 2023

This is a hack to load config early, outside of the real config loader (which handles all these issues)
Really the geofence loading routine could do this with access to full config

@TurtIeSocks
Copy link
Contributor

I'm fine to bring this process internally, but I would need help with it as I couldn't get it to work nicely with the rest of the codebase.

@Fabio1988
Copy link
Contributor Author

Fabio1988 commented Mar 22, 2023

@jfberry could we merge that fix until we find a better solution pls? :)
the actual state is broken for some cases, this would fix it :)

@jfberry
Copy link
Collaborator

jfberry commented Mar 22, 2023

The fix you have taken out was introduced because it was crashing

@Fabio1988
Copy link
Contributor Author

The fix you have taken out was introduced because it was crashing

weird it's not crashing for me with that change. so we have several cases. and we definitely have to fix/rework the way how we use koji

@jfberry
Copy link
Collaborator

jfberry commented Mar 22, 2023

It was a specific user who could not start poracle

@Fabio1988
Copy link
Contributor Author

Fabio1988 commented Mar 22, 2023

There is a try/catch which should do it's job.... I will reopen the issue again

@Fabio1988 Fabio1988 closed this Mar 22, 2023
@Fabio1988 Fabio1988 deleted the patch-1 branch March 22, 2023 20:13
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.

3 participants