Test_policy failed in gitlab but not locally

Hi, I run test_policy on my machine and it passes correctly but when I push it doesn’t pass and generates the next error: https://gitlab.com/autonomicmind/challenges/-/jobs/623330701

image

Thanks!

Bro I have the same error and look in the repository they made a modification in the “test-policy/main.py” I tried to make a pull to download those changes but it didn’t work. :roll_eyes:

Hi @red-skill and @clean-camera. The cause of the error is the new python policy checker, which uses the active branch name in order to do its calculations. I just discovered that when running Gitlab integrations, HEAD is detached and no branch is currently available, thus causing the error. I will work on a fix and let you guys know.

1 Like

All of us have the same issue:

Test_policy is failing for all users since yesterday, I will add some links from different users:

link1

link2

link3

I found that more users have the same issue, but how is the same I only add those 3.

And this is the link from 1 commit:

commit

Ok, Thank U. I’ll be waiting for your message. :grinning:

A fix just got approved. Please rebase your branches, retry and let me know if anything fails.

Hi @infinite-loop , I rebase the master branch, an now the error I’m having is:

https://gitlab.com/autonomicmind/challenges/-/jobs/623571708

File “/nix/store/3jmwvx26isq9j4wh56g1ay2cxmz5px9x-ruamel.yaml0.16.10/site-packages/ruamel/yaml/comments.py”, line 753, in getitem
113 return ordereddict.getitem(self, key)
114KeyError: ‘langs’
115We have found some problems :frowning:
116 You can replicate this by running:
117 services $ ./build.sh test_policy

You are right, some checks are running when they should not. Uploading fix. Thank you for your patience :smile:

@perceived-doubt Can you please retry and let me know if it works now.

@infinite-loop yep, now it works like a charm, thanks.

Hi @infinite-loop, Im having a problem when I am trying to create my branch. It doesn’t pass the test policy. I have tried to create the branch two times but on the intents this error appear:
https://gitlab.com/autonomicmind/challenges/-/jobs/661024724

how could i solve it?.
Thanks!

@fat-byte For some reason your solution is not being found. Maybe your branch name was different from your solution name? Also, I see your MR was already approved. Did you find the error?

Hi @infinite-loop, that is the problem. i didnt upload any solution. I was trying to create my branch for execute git branch -u origin/master in my local folder to follow the master. So don’t I need that?, is just create the local branch with my username, upload the solution and push it to the master?

Oh, I see… Actually, creating your branch can be achieved in several ways, the most typical being running the git command git branch <mybranch>. Once you run that on your machine, a local branch is created. Then you can move to it by running git checkout <mybranch>. Once you commit the changes you want to merge to master, you can simply push your branch. In short: You don’t have to push your branch before uploading any changes, you can keep it locally with no problem.

The error triggers because you pushed someone else’s commit (master HEAD) when you pushed your empty branch, making the script not able to find a valid solution for your branch name.

1 Like

Okay, so that was the problem. Thanks for the support.