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

Incorrect parsing of .gitreview file #18

Closed
ModeSevenIndustrialSolutions opened this issue Oct 15, 2024 · 2 comments · Fixed by #19
Closed

Incorrect parsing of .gitreview file #18

ModeSevenIndustrialSolutions opened this issue Oct 15, 2024 · 2 comments · Fixed by #19
Labels
bug Something isn't working

Comments

@ModeSevenIndustrialSolutions
Copy link
Contributor

An initial test workflow invocation failed for ONAP:
https://github.com/onap/portal-ng-bff/actions/runs/11346946427/job/31557176880

The exact error occurs when parsing the .gitreview file:

++ grep -E host .gitreview
++ cut -d = -f2
+ gerrit_server=gerrit.onap.org
++ grep -E port .gitreview
++ cut -d = -f2
+ gerrit_server_port='29418
portal-ng/bff'
+ echo GERRIT_SERVER=gerrit.onap.org
+ echo 'GERRIT_SERVER_PORT=29418
portal-ng/bff'
Error: Unable to process file command 'env' successfully.
Error: Invalid format 'portal-ng/bff'

I've tested the extraction of these variables from a local shell in the portal-ng/bff repository.

Here's the .gitreview contents:

[gerrit]
host=gerrit.onap.org
port=29418
project=portal-ng/bff
defaultbranch=master%

Here's my output:

bff (🌴 github2gerrit) % gerrit_server=$(grep -E "host" .gitreview | cut -d "=" -f2)
bff (🌴 github2gerrit) % gerrit_server_port=$(grep -E "port" .gitreview | cut -d "=" -f2)
bff (🌴 github2gerrit) % echo $gerrit_server
gerrit.onap.org
bff (🌴 github2gerrit) % echo $gerrit_server_port
29418 portal-ng/bff

Seems the port number has additional output appended (in this case we are accidentally capturing the next line containing the text "portal-ng/bff"). I will raise a PR to more carefully populate the required value.

@ModeSevenIndustrialSolutions
Copy link
Contributor Author

@ModeSevenIndustrialSolutions
Copy link
Contributor Author

Pull request raised here: #19

@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions added the bug Something isn't working label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant