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

Update to python 3.8 in Cypress workflow #639

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

ZitaNemeckova
Copy link
Member

@ZitaNemeckova ZitaNemeckova commented Jul 15, 2021

Cypress workflow got broken by ansible/galaxy_ng#836

TODO: find a way to prevent it, if possible.

@ZitaNemeckova ZitaNemeckova requested a review from himdel July 15, 2021 20:50
@himdel
Copy link
Collaborator

himdel commented Jul 15, 2021

👍 Fixes ...

STEP 4: RUN ln /usr/local/lib/python3.6/site-packages/pulp_ansible/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_ansible.conf
ln: failed to access '/usr/local/lib/python3.6/site-packages/pulp_ansible/app/webserver_snippets/nginx.conf': No such file or directory
error building at STEP "RUN ln /usr/local/lib/python3.6/site-packages/pulp_ansible/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_ansible.conf": error while running runtime: exit status 1
time="2021-07-15T19:10:16Z" level=error msg="exit status 1"
Error: Process completed with exit code 1.

during the Build pulp-galaxy-ng step.

@himdel himdel merged commit 00836c8 into ansible:master Jul 15, 2021
@himdel
Copy link
Collaborator

himdel commented Jul 15, 2021

TODO: find a way to prevent it, if possible.

So,
the Containerfile we're using for cypress .. https://github.com/ansible/ansible-hub-ui/blob/master/.github/workflows/cypress.yml#L50-L60
is a fork of the pulp-galaxy-ng image from pulp-oci-images: https://github.com/pulp/pulp-oci-images/blob/latest/pulp_galaxy_ng/Containerfile .

We could pull from that repo instead of hardcoding our own version, the repo was updated in pulp/pulp-oci-images#103 so it would have been up to date.

The problem is that the image also hardcodes a couple of versions which are wrong for us:

-FROM pulp/pulp-ci-centos:latest
+# default podman config on debian doesn't assume docker.io if no registry specified
+FROM docker.io/pulp/pulp-ci-centos:latest

+# we don't need any of these, definitely not galaxy_ng_version
-ARG PULPCORE_VERSION=">=3.11.2,<3.12"
-ARG PULP_CONTAINER_VERSION=">=2.5.2,<2.6"
-ARG PULP_ANSIBLE_VERSION="==0.7.3"
-ARG GALAXY_NG_VERSION="==4.3.1"

 RUN pip3 install --upgrade \
+  "click<8.0" # might no longer be needed?
   requests \
-  pulpcore${PULPCORE_VERSION} \
-  pulp-container${PULP_CONTAINER_VERSION} \
-  pulp-ansible${PULP_ANSIBLE_VERSION} \
-  galaxy-ng${GALAXY_NG_VERSION}
+  git+https://github.com/ansible/galaxy_ng.git@${{ env.SHORT_BRANCH }} # run galaxy master, stable-4.2 or stable-4.3
 
 RUN ln /usr/local/lib/python3.8/site-packages/pulp_ansible/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_ansible.conf
 RUN ln /usr/local/lib/python3.8/site-packages/pulp_container/app/webserver_snippets/nginx.conf /etc/nginx/pulp/pulp_container.conf
 RUN ln /usr/local/lib/python3.8/site-packages/galaxy_ng/app/webserver_snippets/nginx.conf /etc/nginx/pulp/galaxy_ng.conf

So, we may be able to pull that file, run a script to update it for our needs and then use the updated version.
Not sure if that would be more or less brittle than the current though, might be worth trying :)

Another option might be to RUN ln .../python*/... instead of hardcoding the python version .. assuming only one exists should be safe enough.

jerabekjiri pushed a commit to jerabekjiri/ansible-hub-ui that referenced this pull request Jul 20, 2021
@himdel himdel added the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jul 21, 2021
@patchback
Copy link

patchback bot commented Jul 21, 2021

Beep beep boop!
🤖 Hi, I'm @patchback — your friendly neighborhood robot!

Somebody's just asked me to create a backport of this pull request
into the stable-4.3 branch. So in this comment I report that
I'm on it!

Please, expect to see further updates regarding my progress in updates
to this comment. Stay tuned!

If you think I'm experiencing problems, ping @webknjaz — my creator.

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

Adding backport-4.3, to fix python version failures in 4.3 .. https://github.com/ansible/ansible-hub-ui/pull/672/checks?check_run_id=3123350899

@webknjaz
Copy link
Member

Try re-adding the label. I just received a Sentry error notification. Not sure what happened but it seems like git push failed.

@himdel himdel added backport-4.3 This PR should be backported to stable-4.3 (2.0) and removed backport-4.3 This PR should be backported to stable-4.3 (2.0) labels Jul 21, 2021
@patchback
Copy link

patchback bot commented Jul 21, 2021

Beep beep boop!
🤖 Hi, I'm @patchback — your friendly neighborhood robot!

Somebody's just asked me to create a backport of this pull request
into the stable-4.3 branch. So in this comment I report that
I'm on it!

Please, expect to see further updates regarding my progress in updates
to this comment. Stay tuned!

If you think I'm experiencing problems, ping @webknjaz — my creator.

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@webknjaz
Copy link
Member

Weird, it happened again. I wonder if somebody's been messing with the permissions lately...

@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

@webknjaz I hope not, it worked an hour ago in #672

@webknjaz
Copy link
Member

It could be a GH problem or they could change something in the permission model. Try another PR to see if it happens again maybe...

@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

@webknjaz Seems to be working just fine in #674, so .. one of those things :)

I can do this one manually, thanks for looking :)

@webknjaz
Copy link
Member

Please postpone this for 15-30 min, I think I've found the root of the issue. And also I noticed another problem in the code but I want to trigger this flow after the fix once again.

@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

No problem :)

@webknjaz
Copy link
Member

Could you re-apply the label so I could see if I've properly fixed the exception? (there was a silly "tuple doesn't have a replace method" mistake while producing a log message and it wasn't logged properly because of this)

@himdel himdel added backport-4.3 This PR should be backported to stable-4.3 (2.0) and removed backport-4.3 This PR should be backported to stable-4.3 (2.0) labels Jul 21, 2021
@patchback
Copy link

patchback bot commented Jul 21, 2021

Beep beep boop!
🤖 Hi, I'm @patchback — your friendly neighborhood robot!

Somebody's just asked me to create a backport of this pull request
into the stable-4.3 branch. So in this comment I report that
I'm on it!

Please, expect to see further updates regarding my progress in updates
to this comment. Stay tuned!

If you think I'm experiencing problems, ping @webknjaz — my creator.

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@webknjaz
Copy link
Member

Urgh.. need another patch. I'll keep you posted.

@webknjaz
Copy link
Member

Debugging in production be like: Please, retry again...

After this attempt, hopefully the underlying problem will show up in the bot comment. It is indeed a permission error:

! [remote rejected] HEAD -> patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639 (refusing to allow a GitHub App to create or update workflow .github/workflows/cypress.yml without workflows permission)
To https://github.com/ansible/ansible-hub-ui.git
error: failed to push some refs to 'https://x-access-token:[Filtered]@github.com/ansible/ansible-hub-ui.git'

@ZitaNemeckova ZitaNemeckova deleted the fix_cypress branch July 21, 2021 13:17
@webknjaz
Copy link
Member

I just want this last test before requesting the proper permission on the App side.

@himdel himdel removed the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jul 21, 2021
@himdel himdel added the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jul 21, 2021
@patchback
Copy link

patchback bot commented Jul 21, 2021

Backport to stable-4.3: 💔 cherry-picking failed — conflicts found

❌ Unknown conversion specifier d

Backporting merged PR #639 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-hub-ui.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639 upstream/stable-4.3
  4. Now, cherry-pick PR Update to python 3.8 in Cypress workflow #639 contents into that branch:
    $ git cherry-pick -x 00836c829d0f7851ec451fbf47f388a3bf2603db
    If it'll yell at you with something like fatal: Commit 00836c829d0f7851ec451fbf47f388a3bf2603db is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 00836c829d0f7851ec451fbf47f388a3bf2603db
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Update to python 3.8 in Cypress workflow #639 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@webknjaz
Copy link
Member

Ouch... Still, there's a problem. Need another patch.

@webknjaz
Copy link
Member

webknjaz commented Jul 21, 2021

@himdel could you relabel once again? Funny how much time may pass until somebody hits a rare code branch 🤯. Also, an hour ago had no idea my bot was installed in this repo...

@himdel himdel added backport-4.3 This PR should be backported to stable-4.3 (2.0) and removed backport-4.3 This PR should be backported to stable-4.3 (2.0) labels Jul 21, 2021
@patchback
Copy link

patchback bot commented Jul 21, 2021

Backport to stable-4.3: 💔 cherry-picking failed — could not push

❌ Current GitHub App installation does not grant sufficient privileges for pushing to https://github.com/ansible/ansible-hub-ui.git. Lacking Contents: write or Workflows: write permissions are known to cause this.

the underlying command output was:

$ git --git-dir /tmp/ansible--ansible-hub-ui---stable-4.3---_5lw3yc_---PR-639.git/.git --work-tree /tmp/ansible--ansible-hub-ui---stable-4.3---_5lw3yc_---PR-639.git -c user.email=patchback@sanitizers.bot -c user.name=Patchback push --force-with-lease origin HEAD

[RETURN CODE]: 1

[OUTPUT]:


[STDERR]:

Backporting merged PR #639 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-hub-ui.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639 upstream/stable-4.3
  4. Now, cherry-pick PR Update to python 3.8 in Cypress workflow #639 contents into that branch:
    $ git cherry-pick -x 00836c829d0f7851ec451fbf47f388a3bf2603db
    If it'll yell at you with something like fatal: Commit 00836c829d0f7851ec451fbf47f388a3bf2603db is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 00836c829d0f7851ec451fbf47f388a3bf2603db
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Update to python 3.8 in Cypress workflow #639 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

Heheh, it's everywhere :)

And no worries, I too know the pains of debugging these things :)

@webknjaz
Copy link
Member

I guess I'll stop now. Even though there are more imporovements to do (like making stderr/stdout actually show up), I'll postpone this — the displayed note is useful enough already and I need to switch over to other tasks.
Will ask @gundalow to update the permissions and this should fix it.

@webknjaz
Copy link
Member

@himdel the permissions are fixed now. If you retry, it should create a backport.

@himdel himdel removed the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jul 21, 2021
@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

Thanks for the update! :)

In the meantime I've found out that we need to stay on python3.6 on that branch for now.
Removing the label.

@webknjaz
Copy link
Member

Maybe you could trigger it just for the sake of a test (and then close the PR).

@himdel himdel added the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jul 21, 2021
@patchback
Copy link

patchback bot commented Jul 21, 2021

Backport to stable-4.3: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 00836c8 on top of patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639

Backporting merged PR #639 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-hub-ui.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639 upstream/stable-4.3
  4. Now, cherry-pick PR Update to python 3.8 in Cypress workflow #639 contents into that branch:
    $ git cherry-pick -x 00836c829d0f7851ec451fbf47f388a3bf2603db
    If it'll yell at you with something like fatal: Commit 00836c829d0f7851ec451fbf47f388a3bf2603db is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 00836c829d0f7851ec451fbf47f388a3bf2603db
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Update to python 3.8 in Cypress workflow #639 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4.3/00836c829d0f7851ec451fbf47f388a3bf2603db/pr-639
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

Ah, sure :) here it goes ^ :)

(I guess that's no longer so helpful is it? :( )

Let me know if you want us to create/find a PR that touches a workflow and can be backported cleanly.

@himdel himdel removed the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Jul 21, 2021
@webknjaz
Copy link
Member

Let me know if you want us to create/find a PR that touches a workflow and can be backported cleanly.

That would be nice, if it's not too much of a hustle :)

@himdel
Copy link
Collaborator

himdel commented Jul 21, 2021

It may take a bit, but I think we'll be able to try with #642 once merged, I'll ping you tomorrow today :)

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.

None yet

3 participants