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 issues with translation deployment script #10667

Merged
merged 4 commits into from
Sep 5, 2023

Conversation

mtreinish
Copy link
Member

Summary

During the 0.25.1/0.44.1 release the translation publishing step failed. This was because of a parsing error with the ssh private key during the decryption step. This seems to be due to how the action was configured to load the private key post decryption into an env variable that github actions would then use for it's checkout action to handle cloning with authentication via ssh. This commit switches back to just using a standalone bash script that has proven to be reliable historically and also gives us tighter control on how commands get executed. As part of this a new encrypted private key is added to the repo as the previous key has been revoked and invalidated since the job failure during the release.

Details and comments

During the 0.25.1/0.44.1 release the translation publishing step failed.
This was because of a parsing error with the ssh private key during the
decryption step. This seems to be due to how the action was configured
to load the private key post decryption into an env variable that github
actions would then use for it's checkout action to handle cloning with
authentication via ssh. This commit switches back to just using a
standalone bash script that has proven to be reliable historically and
also gives us tighter control on how commands get executed. As part of
this a new encrypted private key is added to the repo as the previous
key has been revoked and invalidated since the job failure during the
release.
@mtreinish mtreinish added type: qa Issues and PRs that relate to testing and code quality stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Aug 18, 2023
@mtreinish mtreinish added this to the 0.25.2 milestone Aug 18, 2023
@mtreinish mtreinish requested a review from a team as a code owner August 18, 2023 13:58
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5903498041

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.02%) to 87.267%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.76%
crates/qasm2/src/lex.rs 4 91.14%
Totals Coverage Status
Change from base Build 5902014500: 0.02%
Covered Lines: 74360
Relevant Lines: 85210

💛 - Coveralls

Eric-Arellano
Eric-Arellano previously approved these changes Aug 18, 2023
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thanks!

tools/deploy_translatable_strings.sh Outdated Show resolved Hide resolved
tools/deploy_translatable_strings.sh Outdated Show resolved Hide resolved
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

It was pretty poor work on my part not to have better tested the secrets management in the new form - I'd removed that section so I could test the rest of the script, but I should have used dummy credentials. I think I just ran out of time on the way out to holiday, but I really should have thought of it.

I have a vague preference towards the new form (but I can fix it so it doesn't leak the secret lol), since I personally find it much easier to read and it uses more of the GitHub Actions machinery to efficiently manage git operations and secret management, but I'm not super broken up about it. Originally I'd intended to completely reuse much more of the Python environments, but tox doesn't make that especially easy, so it's probably not so big a deal until we have something like a lockfile for the artifact generation for docs.

tools/deploy_translatable_strings.sh Outdated Show resolved Hide resolved
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake@binhbar.com>
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

I'm trying to remember all the changes to this script that I made when I moved it over to fix problems with it, but it's a bit bits-and-pieces because I did it a couple of weeks ago now in the midst of a lot of other busy stuff, and I don't remember everything.

Would you prefer if I try and fix the secret sharing on the new form of the action, or would you much prefer to revert to the stand-alone script?

tools/deploy_translatable_strings.sh Outdated Show resolved Hide resolved
@@ -80,7 +80,7 @@ git add setup.py
git add requirements-dev.txt constraints.txt
Copy link
Member

Choose a reason for hiding this comment

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

This line and the setup above it is wrong now as well - we need to clone more stuff into the translations repository if they're going to be able to build the Terra documentation like this.

Copy link
Member Author

Choose a reason for hiding this comment

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

This line should actually be fine because of L74. The requirements-dev.txt should include all the dependencies needed to build the docs. The translations CI will install a bit more than they were before but I don't think that's a huge issue. But yeah the setup.py will be a problem, it should be qiskit_pkg/setup.py

Copy link
Member

Choose a reason for hiding this comment

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

Ah, sorry, yeah - so much of the file was completely identical that I'd missed that you'd included a couple of things above. Still, yeah, I think the current setup.py would break.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I just went to update the setup.py and it's correct too, at L70 I have it copy the setup.py from $SOURCE_DIR/qiskit_pkg/setup.py to the root of the translations checkout, so adding the setup.py here is adding the expected file.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not a huge fan of how much we're mixing-and-matching bits and bobs of configuration files here to make a semi-functional package for the translations repo, but I don't have any better solution, so I guess let's just move to merge and get these rolling again.

@@ -80,7 +80,7 @@ git add setup.py
git add requirements-dev.txt constraints.txt
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a huge fan of how much we're mixing-and-matching bits and bobs of configuration files here to make a semi-functional package for the translations repo, but I don't have any better solution, so I guess let's just move to merge and get these rolling again.

@jakelishman jakelishman added this pull request to the merge queue Sep 5, 2023
Merged via the queue into Qiskit:main with commit cd1196c Sep 5, 2023
14 checks passed
mergify bot pushed a commit that referenced this pull request Sep 5, 2023
* Fix issues with translation deployment script

During the 0.25.1/0.44.1 release the translation publishing step failed.
This was because of a parsing error with the ssh private key during the
decryption step. This seems to be due to how the action was configured
to load the private key post decryption into an env variable that github
actions would then use for it's checkout action to handle cloning with
authentication via ssh. This commit switches back to just using a
standalone bash script that has proven to be reliable historically and
also gives us tighter control on how commands get executed. As part of
this a new encrypted private key is added to the repo as the previous
key has been revoked and invalidated since the job failure during the
release.

* Apply suggestions from code review

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake@binhbar.com>

* Update tools/deploy_translatable_strings.sh

Co-authored-by: Jake Lishman <jake@binhbar.com>

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake@binhbar.com>
(cherry picked from commit cd1196c)
github-merge-queue bot pushed a commit that referenced this pull request Sep 6, 2023
* Fix issues with translation deployment script

During the 0.25.1/0.44.1 release the translation publishing step failed.
This was because of a parsing error with the ssh private key during the
decryption step. This seems to be due to how the action was configured
to load the private key post decryption into an env variable that github
actions would then use for it's checkout action to handle cloning with
authentication via ssh. This commit switches back to just using a
standalone bash script that has proven to be reliable historically and
also gives us tighter control on how commands get executed. As part of
this a new encrypted private key is added to the repo as the previous
key has been revoked and invalidated since the job failure during the
release.

* Apply suggestions from code review

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake@binhbar.com>

* Update tools/deploy_translatable_strings.sh

Co-authored-by: Jake Lishman <jake@binhbar.com>

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake@binhbar.com>
(cherry picked from commit cd1196c)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog priority: high stable backport potential The bug might be minimal and/or import enough to be port to stable type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants