Skip to content

Fix alpha updates and lint error reporting#10020

Merged
feerrenrut merged 5 commits intomasterfrom
fixAlphaUpdates
Aug 2, 2019
Merged

Fix alpha updates and lint error reporting#10020
feerrenrut merged 5 commits intomasterfrom
fixAlphaUpdates

Conversation

@feerrenrut
Copy link
Contributor

Link to issue number:

Summary of the issue:

Description of how this pull request fixes the issue:

  • Use a structure preserving mechanism to upload artifacts
  • Read PR-Flake8.txt as ANSI, ignore errors.

Testing performed:

  • Wait for build to complete, see if artifact URL is as required.
  • Locally converted the Flake8.txt file from the example failed build using the createJunitReport.py script

Known issues with pull request:

Change log entry:

Section: New features, Changes, Bug fixes

When the artifacts are uploaded, they need to preserve the folder structure.
Despite a folder structure, all atrifacts are listed on the appveyor build
result page in a flat way.
Decoding as UTF-8 was not working for lint output, use ANSI
and replace on error instead.
@feerrenrut feerrenrut requested a review from LeonarddeR August 2, 2019 12:34
@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Aug 2, 2019 via email

@feerrenrut
Copy link
Contributor Author

I copied the powershell code for uploading the artifacts from an appveyor example, it turns out it was quite broken. I think I have fixed it.

@AppVeyorBot
Copy link

Build execution time has reached the maximum allowed time for your plan (60 minutes). 😲

See test results for Failed build of commit 9f5febe045

@feerrenrut
Copy link
Contributor Author

oops, looks like this tried to upload the whole repo 😨

@feerrenrut feerrenrut merged commit 7b5cd2d into master Aug 2, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Aug 2, 2019
@feerrenrut feerrenrut deleted the fixAlphaUpdates branch January 17, 2020 08:57

def makeJunitXML(inFileName, outFileName):
with open(inFileName, 'rt', encoding='UTF-8') as flake8In:
with open(inFileName, 'rt', encoding='ANSI', errors='replace') as flake8In:
Copy link
Contributor

Choose a reason for hiding this comment

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

@feerrenrut
Do you think we might reconsider this line now that Flake8 runs in UTF-8 Mode as of #11108?
errors='replace' is probably still a good strategy, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps so, I vaguely remember that this was a pain. If I recall, the encoding of the file was for some reason different on appveyor than it was locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps so, I vaguely remember that this was a pain. If I recall, the encoding of the file was for some reason different on appveyor than it was locally.

Without the -Xutf8 flag, the encoding of the file was in the default encoding of the system,, and I have no clue if it differs between your local system and AppVeyor.
My best bet is that we should probably add the -Xutf8 to most if not all invocation of py by AppVeyor, but I don't have an AppVeyor test bed to check this idea.
I might by the way give it a try on every invocation of sys.executable made from SCons...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the encoding of the file was in the default encoding of the system

Yep, that sounds familiar.

My best bet is that we should probably add the -Xutf8 to most if not all invocation of py

This sounds like a reasonable approach. Is there anyway we can just set it a default option for python?

Copy link
Contributor

Choose a reason for hiding this comment

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

This sounds like a reasonable approach. Is there anyway we can just set it a default option for python?

Fortunately yes, there is one.
PEP 540 introduced the use of the PYTHONUTF8 environment variable. When set to 1, UTF-8 Mode is activated.
Note however that PYTHONIOENCODING and PYTHONLEGACYWINDOWSFSENCODING (PEP 529) take precedence when set.
If this approach is fine for AppVeyor build, I guess my recent addition of -Xutf8 for Flake8 shall then be removed from appveyor.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I think I prefer the -Xutf8 approach over environment variables, I might be paranoid but I feel it's very easy for environment variables to be modified by some layer and become really hard to find the cause of. We should probably be using something like tox

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.

5 participants