design: Figure out how we want to spawn our NPCs

Atm I just added a Spawn villager button back in the UI but this has to go for the final integration

Closed by #48 and previously merged PRs


UntilFilesExists should look for file in container

What does this PR do?
The existing implementation of the UntilFileExists WaitStrategy seems to look for a file in the host's file system instead of the container's.
This PR changes that so UntilFileExists looks for the file in the container's file system instead.
Why is it important?
Looking for a file on the host instead of the container seems like incorrect behavior.

Thank you for your pull request. This is some kind of on purpose, but I understand the confusion regarding the wait strategy. I would like to suggest the following in order to avoid breaking existing configurations:

Enhance the UntilFileExists(string) documentation (interface) and make it more explicit that it checks for a file on the test host.
Add an overloaded method that checks for the file inside the container.

We can also introduce two explicit APIs (wait strategies): One that checks on the test host and another that checks in the container, while deprecating the old one. My goal is to avoid introducing breaking changes without informing the developers.

Good point. Should I move the code into a UntilFileExistsInContainer(string) method (+ a related WaitStrategy class) maybe? That naming should make the distinction clearer between the two.

Good point. Should I move the code into a UntilFileExistsInContainer(string) method (+ a related WaitStrategy class) maybe? That naming should make the distinction clearer between the two.

Yes, I think that would be a better and more explicit approach. I am currently thinking how we can enhance the wait strategy API in a broader sense, without the need for a complete overhaul. The wait strategy API has remained unchanged since its early days. Perhaps an approach similar to the HttpWaitStrategy, which allows more configurations, would be a more future-proof solution. We could consider implementing something like a FileSystemWaitStrategy, which accept a file path and a scope to determine whether it is a file within a container or a file on the test host.

I see that the HttpWaitStrategy has different usage pattern to the 'normal' wait strategies. Do we need to go there with this? Maybe something like Wait.ForUnixContainer().UntilFileExists("/foo/bar", FileSystem.Host) would suffice? And have the default scope value as Host to avoid breaking any existing functionality.
And do you have any suggestions for what to call the scope enum?

Do we need to go there with this? Maybe something like

No, I think your suggestion is reasonable.

And do you have any suggestions for what to call the scope enum?

FileSystem.Host, FileSystem.Container sounds good 👍.

I have updated the code as per our discussion. I was unsure of where to put the FileSystem enum but ended up putting it under TestContainers.Configurations as I felt it was a more generic thing than WaitStrategies. What do you think?

I took a brief look. It looks very good. Great first contribution, thanks. I won't be able to finalize the review today, but I can certainly do it tomorrow.


Fix date display for events starting on the first of the month

We’re having this issue on 2 events right now, MakeSPP & DistanceHacks. I suspect that timezones are biting us somehow—had the same issue on Events, but haven’t fully investigated.


update to Font Awesome Free Solid-5.13.0

I just figured out that FA broke naming compatibility with version 4.3 so the PR should NOT be merged to avoid breaking projects using no longer supported names.
I tought about modifying the template to integrate a 4.3 compatibility list of naming but there are to many changes. Sorry for the inconvenience.


updating travis.yml to fix node-sass issue

Workaround for this issue: https://github.com/sass/node-sass/issues/1804

Has been fixed already


Localization settings

Version: 1.3.0
Brief Issue Summary
This extension picks the system locale automatically for displaying localized strings, but there isn't a setting for controlling this behavior (which locale to use) explicitly.
Expected:
Please add such setting.

VS Code manages the locale settings.  We just provide the strings for the locales.  Have you tried selecting a language with the "Configure Display Language" command?

When I explicitly configure the display language, this extension displays strings in that language without problem; when the display language was initially left unconfigured however, VSCode defaulted to displaying in English, but this extension used the system locale (which on my machine is not English).  It may be regarded as a bug in Code or in this extension depending on your decision, but is definitely an inconsistency.

Yes, I agree there is an inconsistency here.  The VS Code team releases their language support as separate language extensions that you have to install.  Most extensions bundle the language support.
We opened this issue for them to consider: https://github.com/microsoft/vscode/issues/82791


modelFor doesn't like / in names

E.g. this.modelFor('accounts/show') wont work, but this.modelFor('accounts.show') does.

In my ember engines app, this.modelFor('admin.tasks.bookings.view') within "admin.tasks.bookings.view.rooms.index" route file returns undefined.  Even just this.modelFor('admin') returns undefined.   In fact, when I view my ember engines app in the inspector, the routes tab does not display the routes.
Would appreciate if someone can shed some light on this:
The below is my route structure:
export default buildRoutes(function() {
    this.route('admin', function() {
        this.route('tasks', function() {
            this.route('bookings', function() {
                this.route('view', { path: '/view/:booking_id' }, function() {
                    this.route('rooms', function() {
                        this.route('add');
                        this.route('edit', { path: '/edit/:room_id' });
                    });
                });
            });
        });
    });
});

My Environment is:
Ember Inspector	2.0.4
Ember	2.8.2
Ember Data	2.9.0
jQuery	3.1.1
Ember Simple Auth	1.1.0
ReservationAdminEngineAddon	v0.0.2

@alexmasita The issue you're reporting is distinct from the original report in this thread. Can you please move it to a new issue and delete the comment here so we can track them separately? (Otherwise we won't remember to address your issue.)

I don't think ember-engines alters anything about the modelFor method on routes and AFAIK route names always need to be defined using dots instead of slashes. I think we can close this issue?


Code restructure

Can we work on restructuring the code. It is a little confusing to look at and hard track the control flow.
My first suggestion is to decouple input handling from the main_search.
Creating an object of main_search (possibly rename this file, it is doing more than search) in driver and calling methods from here seems more logical.

Yes, why not? Are you willing to take it up?

Sure, I can work on that.

Closing the issue.


[Python: flake8] Update the project .flake8 config to prepare for the black code formatting tool.

This PR updates the project .flake8 config file to prepare for the Python Software Foundation's black code formatting tool.

@swift-ci please smoke test

@swift-ci please smoke test

I think the version of flake8 on the bots is older than 3.6.0, so they don't know about the --extend-ignore option.


⚠ GitLab Server has degraded performance

In 93a1796, GitLab Server (https://gitlab01.its-telekom.eu) experienced degraded performance:

HTTP code: 200
Response time: 2820 ms

Resolved: GitLab Server performance has improved in 7d6f2ed.


Add mongodb 4.4, remove 3.6. Also remove P7.

Removing Pharo 7 wasn't necessary but I considered it is enough to test on current stable and development versions (and thus have a smaller build matrix).

I had to perform changes in some tests because errors raised by the server slightly changed.
For example, in two tests I had to use w: 50 instead of w: 1000 to generate a invalid concern, since mongodb 4.4 throws a parsing error: "w has to be a non-negative number and not greater than 50".


Level 5 Exception in thread "main" java.util.NoSuchElementException

Summary
I encounter this issue when uploaded to codecrunch
![Screenshot 2022-03-21 at 9 49 02 PM (2)]()
Description:
I can run the code in jshell as per normal
Code Snippets
`
import java.util.Scanner;
class Main {
public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    Roster roster = new Roster("Hello World");

    for (int i = 0; i < n; i++) {
        roster = roster.add(sc.next(), sc.next(), sc.next(), sc.next());
    }

    while (true) {
        System.out.println(roster.getGrade(sc.next(), sc.next(), sc.next()));
    }
}

}
`
Attach code snippets (if any)
Screenshots
Screenshots (if any)

Maybe try resubmitting? I had this problem just now but I think it resolved itself after I submitted again

Hi, can I ask if the code in the snippet gives the correct output? Doesn't it print the grade immediately after the query?

Hi, can I ask if the code in the snippet gives the correct output? Doesn't it print the grade immediately after the query?

Ya I used the same way as him and the output seems wrong. Initially I stored the String in an arraylist which works but that isn't allowed according to CC. Have you figured out a way?

Ya I used the same way as him and the output seems wrong. Initially I stored the strings in an arraylist which works but that isn't allowed according to CC. Have you figured out a way?

You can add the getGrade + \n  into a string then System.out.println that string after the scanner is closed.

Hi, can I ask if the code in the snippet gives the correct output? Doesn't it print the grade immediately after the query?

Ya I used the same way as him and the output seems wrong. Initially I stored the strings in an arraylist which works but that isn't allowed according to CC. Have you figured out a way?
Edit: Never mind submitting it to CC gives an A although on the terminal the output is different

For it to work it the terminal like what it's shown in the task sheet, you could copy and paste the whole chunk instead of copy and pasting line by line.


Refactoring for new Auth

Hi,
This is a little bit of a refactor for the new Auth. I have it working locally.
I will be happy to make any changes.
Todo

[x] Clean up auth.py
[x] Rename auth.py to panasonic_auth.py
[x] Rework error handling to be more explicit on authentication token expiration handling
[x] Centralize that error handling if i can
[x] auth.login() should only be called if the clientId isn't known. So check for that, before calling it.

@little-quokka I like your implementation of panasonic_session.py

thanks, some notes on the code:

auth.login should only be called if the X-Client-Id is not yet known, and after that never again. currently it's called on each startup, which differs from how the app works. instead, _acc_client_id should be a stored persistent value tied to the user & login combination and /auth/v2/login only called if the credentials changed or the _acc_client_id is not yet known.

auth.py still has a lot of debug/testing prints that probbably should be removed before it's merged

the bearer token expiration handling seems not yet correct: on every api call the bearer token could be expired. in that case, a token refresh must be done and the call retried. a simple api call wraper function could transparently handle that for all of the accsmart requests. in the current version of the code, only session.login() has some error handling that refreshes the token, but does not check if the error is actually due to an expired Bearer token. the api response will explicitly tell you that the token expired.

agreed @heldchen, I'm currently working on redoing auth.py to clean it up. I also want to introduce a new error handling so that if at all there is a expiration for the token, we can handle that more directly, separating any general error handling from any unauthorized handling.

@heldchen @little-quokka take a look at the changes to panasonic_auth.py

this looks already very clean. I'd recommend to make the following changes

if possible add a boolean parameter include_client_id to  _get_new_token, then the function can also be used in _get_new_token - which makes future changes easier
create a class constant for the X-APP-VERSION version id (f.e.  PanasonicSession.APP_VERSION - this will definitely change when panasonic updates their android app
its generally recommended to name the file the same as the class it contains

if you want to go a bit further, if this was my project I'd abstract the api logic from the rest of the tool's logic even further by doing the following changes:

name the file "apiclient" instead
for each api endpoint of accsmart.panasonic.com that is used by the library, create a function in the client
this allows the separation between api functions of the library, which will make future api changes easier
the function login doesn't just log-in the user. I would move this code to the class constructor __init__(self, username, password, tokenfFileName) and run it automatically when the class is instanciated.

Hi @heldchen, @danielcherubini. Sorry for dropping off yesterday without much morning, but I needed some sleep. Please let me know what I can help with. Unfortunately, I will be less free today than the last two days, but let's see what is possible.

I addressed a few of the issues raised above here:
https://github.com/little-quokka/python-panasonic-comfort-cloud
Specifically:

Constant for X-APP-VERSION
Rename files (class name = file name)
Have ComfortCloudSession be a subclass of PanasonicSession. ComfortCloudSession does all the API calls, PanasonicSession all the token handling
Ensure that before any API call is done, the token is checked for its validity and potentially updated first
Move --raw true message output into a single function

(The branch is based on a 1:1 copy the work from @danielcherubini, but somehow I screwed up some merging and it doesn't show as such. )

Some additional updates (https://github.com/little-quokka/python-panasonic-comfort-cloud):

Improved error handling
Crack open token to check expiry
Move exceptions into separate file
Show response.text on error (previously omitted, was in originally)
Change ComfortCloudSession to ApiClient
Update default token file name to allow this to be run on windows as well as linux without '-t' parameter

Some additional updates (https://github.com/little-quokka/python-panasonic-comfort-cloud):

run pylint and fix (important) stuff reported

That is it for me now. I think most of the issues listed above were attended to. The only one I am unsure about is this one from @heldchen:

if possible add a boolean parameter include_client_id to _get_new_token, then the function can also be used in _get_new_token - which makes future changes easier

I guess the 2nd _get_new_token is another function, just unsure which one.

FYI: the exact code & message received when the token expires is:

http status code 401
body: {"code":"4100", "message": "Token expires"}

Some additional updates (https://github.com/little-quokka/python-panasonic-comfort-cloud):

run pylint and fix (important) stuff reported

That is it for me now. I think most of the issues listed above were attended to. The only one I am unsure about is this one from @heldchen:

if possible add a boolean parameter include_client_id to _get_new_token, then the function can also be used in _get_new_token - which makes future changes easier

I guess the 2nd _get_new_token is another function, just unsure which one.

sorry, I was on my mobile and couldn't be more specific. what I meant is to update the header function so that it can also be used for this step:
        # ------------------------------------------------------------------
        # RETRIEVE ACC_CLIENT_ID
        # ------------------------------------------------------------------
        now = datetime.datetime.now()
        timestamp = now.strftime("%Y-%m-%d %H:%M:%S")
        response = requests.post(
            'https://accsmart.panasonic.com/auth/v2/login',
            headers={
                "Content-Type": "application/json;charset=utf-8",
                "User-Agent": "G-RAC",
                "X-APP-NAME": "Comfort Cloud",
                "X-APP-TIMESTAMP": timestamp,
                "X-APP-TYPE": "1",
                "X-APP-VERSION": "1.20.0",
                "X-CFC-API-KEY": generate_random_string_hex(128),
                "X-User-Authorization-V2": "Bearer " + token_response["access_token"]
            },
            json={
                "language": 0
            })
        check_response(response, 'get_acc_client_id', 200)

-->
        # ------------------------------------------------------------------
        # RETRIEVE ACC_CLIENT_ID
        # ------------------------------------------------------------------
        now = datetime.datetime.now()
        timestamp = now.strftime("%Y-%m-%d %H:%M:%S")
        response = requests.post(
            'https://accsmart.panasonic.com/auth/v2/login',
            headers= self.get_header_for_api_calls(True),
            json={
                "language": 0
            })
        check_response(response, 'get_acc_client_id', 200)

there True denotes the flag that the X-Client-Id header should not be added even if the value would be known (in case the user changed the username & password)

I understand now @heldchen. Unfortunately, there is the issue that the access_token is not in available in self._token[] at this point in time (but only in token_response[]). self._token[] is only filled after all steps were successful to avoid a half-correct state.

How to move forward from here @danielcherubini? Should I open a pull request to your repo? You already have this pull request open to the original repo. Is that the way it works?

How to move forward from here @danielcherubini? Should I open a pull request to your repo? You already have this pull request open to the original repo. Is that the way it works?

@little-quokka yes, open a PR to my repo, and I'll get those changes in tonight, then that updates this PR.

This is out of scope for this PR. But @lostfields I've been thinking, since the Home Assistant Integration so heavily uses this CLI app, but only the core of it... what might be smart, is if we separate the core/common functionality out of this, and put it into it's own repository, then both places can PIP install that as a package.
What do you think?

I think we can keep it in one repository @danielcherubini. I would simply move the contents of main.py into pcomfortcloud.py and remove the entry_point statement in setup.py. Then the pcomfortcloud folder is a library, and the pcomfortcloud.py outside of this folder a CLI/test program which will be useful for testing any changes to the library.

This should do it: https://github.com/little-quokka/python-panasonic-comfort-cloud/commit/c3f39d19c0808e21d7e7ee79e72fac41ffe59426
If used as a library: The contents of a loaded json token can be put into the PanasonicSession if available. If a token is provided but out of date, the token will be refreshed. If no token is provided, a new token will be created. The current token can be retrieved via get_token(). This should be done ideally after start_session().

@little-quokka Brilliant!!!!! I look forward to your PR

I think that is the PR (this is only the 2nd time I do this lately and it seems I screwed it up the first time, so better check): https://github.com/danielcherubini/python-panasonic-comfort-cloud/pull/1

@lostfields We think this is ready for merging now. There's been a big refactoring of this.
The CLI functionality has been moved into the pycomfortcloud.py file, and now the pcomfortcloud folder is a module that can be reused by both the CLI application and also used as a module for the HA Integration
@craibo You're going to like this... So as said above, you can now treat this as a library.. I'm positive you might be able to get it working with pip install and then you won't need to copy the folder into yours every time! Cutting down the complexity.

HUUUUUUUGE thanks to @heldchen @little-quokka @lostfields @craibo and everyone who's helped get this to this place!

@heldchen sorry for not including you in the thanks. But without you none of this would have been possible

no worries, glad I could be of help and thanks everyone on getting this into the integration plugin so fast! this is my first summer with a HVAC and it would have sucked to have to use the Comfort Cloud app :-)

Just wanted to say you're all wonderful! Thank you so, so much. My staff in the office can stop complaining about the AC once this is merged and into the HA integration.

@heldchen I just bought a second Panasonic AC, so now it's more important than ever for me too.
If Panasonic changes something again (and I believe they will) then we now have made the changes to get things moving fast. The amount of seperation of code here, and the new people who have eyes on this will mean any of us can jump in.
I really do believe Panasonic will do something. I know what they will do, but I don't wanna put it into the universe.

@lawrencedudley my suggestion is to switch to @craibo 's fork. I don't know what the main forks maintainer will do. But I think going forward the smartest thing to do is switch

@danielcherubini I'd miss my climate mini dashboard:

@heldchen I'm not understanding, are you saying something is wrong? or are you saying you miss having your dashboard and can't wait to get it working again?

@little-quokka i changed your constant for app version to go get the latest version from the apple app store, the same way that @sockless-coding had it.

the workflows are for the android app and AFAIK the version tied to the client-id. this might fail (it did in my tests earlier this week)

@heldchen I will switch to getting the latest version of the android app instead and see if its the right version

maybe this should be revisited once a new version was released by panasonic? we currently don't know if the oauth client id is also updated with the app version. if it is changing then an automatic updating will not be possible anyway...

I do think that decoupling our releases from panasonics is the wise path here.

one concern though, it's not backward compatible since everything is changed, new entry point, new module entrypoint etc. That may be ok, but it's also harder to do a review. We may have to release this as a new major.

@lostfields i agree on your versioning idea.
@heldchen Looks like I'm going to have to make a simple API to get the google appstore version, this is easy for me to do. and since I have servers here, it comes at no cost.

I wonder if we can automate it via a build pipeline... storing a file in a github repo, or gist.. just a simple json payload, and then use a get request to grab that json, and parse it.

@heldchen @lostfields .. done. I've moved the appversion to a public gist, I will setup a cron job to get the latest version, check it, if it's updated then update the gist with the latest version.

@sockless-coding will the above change work for you?

here's the version changer, i'm going to put it on a 6h cron job

Update from the other PR, looks like theres a great website we can scrape easly and safely.
 def _update_app_version(self):
        if self._raw:
            print("--- auto detecting latest app version")
        try:
            response = requests.get(PanasonicSession.APPBRAIN_URL)
            responseContent = response.content
            soup = BeautifulSoup(responseContent, "html.parser")
            meta_tag = soup.find("meta", itemprop="softwareVersion")
            if meta_tag:
                version = meta_tag['content']
                _LOGGER.debug(f"Found app version: {version}")
                self._app_version = version
                # self._settings.version = version
                if self._raw:
                    print("--- found version: {}".format(self._app_version))
                return

        except Exception as e:
            print(f"Error Get version: {e}")
            pass
        if self._raw:
            print(
                "--- failed to detect app version using version: {}".format(self._app_version))

@danielcherubini @lostfields - I think it is a good idea to bump the version to a new major one.
@lostfields I am now pretty well across the code base, so if you are interested in that, I would be happy to help you out maintain the project.

one concern though, it's not backward compatible since everything is changed (old files deleted, new created), new entry point, new module entrypoint etc. That may be ok, but it's also harder to do a review. We may have to release this as a new major.

Hint: If the public signatures have also changed, the Readme should be updated accordingly.

@lostfields I'm wondering if we can put a major-version number in the config file, then put a check for it.. if it doesn't match, then delete the config file and start fresh. That way we can push versions and not worry about config.
Reason is there's a number of people who seem to have some kind of issue over in the HA integration, now that doesn't exactly use this exact code anymore (I will be updating that a bit tonight) .. it does look like there's an odd config problem here and there. So it might be best to do some kind of check in the config first.. then flush it if it's not what's expected and re-login from scratch.

@heldchen i added your fix for the 404's

thanks. let's hope this unblocks the users that reported this.

@danielcherubini thanks for the typo fix - I also updated the PR in https://github.com/sockless-coding/panasonic_cc/pull/198

Looking at how many issues are in the HA GitHub, I think I wanna hold off on switching to async.
The issue then is that it would seem there is now a huge drift between that integration and this one.
We did refactor this in the hopes that instead of copy/pasting this code into the other git repo, that instead @sockless-coding could use this as a python module.
I would much prefer this is stable with all the auth changes to begin with before introducing a change to the underlying library it uses for requests, and also switching from a synchronous workflow to an asynchronous one.

Looking at how many issues are in the HA GitHub, I think I wanna hold off on switching to async.
The issue then is that it would seem there is now a huge drift between that integration and this one.
We did refactor this in the hopes that instead of copy/pasting this code into the other git repo, that instead @sockless-coding could use this as a python module.
I would much prefer this is stable with all the auth changes to begin with before introducing a change to the underlying library it uses for requests, and also switching from a synchronous workflow to an asynchronous one.

Sure, adapters and wrappers that fits HA is nice but that could be done without making this project a complete new one. Looks like stuff is dragged from another project and replacing everything :-)

Sure, adapters and wrappers that fits HA is nice but that could be done and added without making this project a complete new one. Looks like stuff is dragged from another project and replacing everything :-)

I think we're in agreement, what i'm trying to push is to have this be the single source of truth, the central place for any changes to using the comfort-cloud api. I don't mean to push any specific HA stuff in here. Quite the opposite.

@danielcherubini I thought I'd try the code directly from your repo https://github.com/danielcherubini/python-panasonic-comfort-cloud/tree/master
However, I get the following error when I try to run it and obtain data from one aircon unit
Traceback (most recent call last):
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/./pcomfortcloud.py", line 8, in <module>
    import pcomfortcloud
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/__init__.py", line 13, in <module>
    from .apiclient import (
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/apiclient.py", line 9, in <module>
    from . import panasonicsession
ImportError: cannot import name 'panasonicsession' from partially initialized module 'pcomfortcloud' (most likely due to a circular import) (/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/__init__.py)

I assume it is valid to clone your repo and run it. I'm not sure if I am missing something.

@majurgens thanks, there was a bad import leftover from when i renamed panasonicsession to session

Something different now
./pcomfortcloud.py user pass get 1
Traceback (most recent call last):
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/./pcomfortcloud.py", line 301, in <module>
    main()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/./pcomfortcloud.py", line 214, in main
    session.start_session()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/apiclient.py", line 28, in start_session
    super().start_session()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/session.py", line 296, in start_session
    self._get_new_token()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/session.py", line 273, in _get_new_token
    check_response(response, 'get_acc_client_id', 200)
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/session.py", line 25, in check_response
    raise exceptions.ResponseError(
pcomfortcloud.exceptions.ResponseError: (get_acc_client_id: Expected status code 200, received: 401: {
  "code":4106
}

@danielcherubini something different now
./pcomfortcloud.py user pass get 1
Traceback (most recent call last):
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/./pcomfortcloud.py", line 301, in <module>
    main()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/./pcomfortcloud.py", line 214, in main
    session.start_session()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/apiclient.py", line 28, in start_session
    super().start_session()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/session.py", line 296, in start_session
    self._get_new_token()
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/session.py", line 273, in _get_new_token
    check_response(response, 'get_acc_client_id', 200)
  File "/opt/hvac/python-panasonic-comfort-cloud.danielcherubini/pcomfortcloud/session.py", line 25, in check_response
    raise exceptions.ResponseError(
pcomfortcloud.exceptions.ResponseError: (get_acc_client_id: Expected status code 200, received: 401: {
  "code":4106
}

Same issue for me when trying to use it through the CLI
When trying to use it through Python, I get the following:
With the following code:
session = pcomfortcloud.Session(pcc_user, pcc_password)
session.login()

I get this:
Traceback (most recent call last):
  File "/home/jensd/airco/getinfo.py", line 9, in <module>
    session = pcomfortcloud.Session(pcc_user, pcc_password)
              ^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pcomfortcloud' has no attribute 'Session'. Did you mean: 'session'?

Same thing happens when I try to use this manually from Python:
>>> session = pcomfortcloud.ApiClient(pcc_user, pcc_password, None)
>>> session.start_session()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jensd/airco/python-panasonic-comfort-cloud-master/pcomfortcloud/apiclient.py", line 28, in start_session
    super().start_session()
  File "/home/jensd/airco/python-panasonic-comfort-cloud-master/pcomfortcloud/session.py", line 296, in start_session
    self._get_new_token()
  File "/home/jensd/airco/python-panasonic-comfort-cloud-master/pcomfortcloud/session.py", line 273, in _get_new_token
    check_response(response, 'get_acc_client_id', 200)
  File "/home/jensd/airco/python-panasonic-comfort-cloud-master/pcomfortcloud/session.py", line 25, in check_response
    raise exceptions.ResponseError(
pcomfortcloud.exceptions.ResponseError: (get_acc_client_id: Expected status code 200, received: 401: {
  "code":4106
}

Looking at the HA thread, looks like they changed something. I know it was a new app version so far.

@jensdepuydt @majurgens try now

There was a issue with the way the app version was updated and stored.

That got it. I think that means the PR is ready to be merged

@danielcherubini it mostly seems to work but I am getting the following, apparently non-fatal message on every run --- Error finding meta_tag

strange, i'm not having that issue.

Yes. I even git cloned again (git clone https://github.com/danielcherubini/python-panasonic-comfort-cloud.git) in another local directory

Hi there,
Tried to import new files in my Jeedom install but seeing errors, and since I'm not an expert with code, requesting for help, thanks!

#!/usr/bin/env python3 /var/www/html/plugins/script/data/pcomfortcloud/pcomfortcloud.py -t pcomfortcloud-token email@address secret_password get 2 2>&1 returned value : 1. Détails : Traceback (most recent call last): File "/var/www/html/plugins/script/data/pcomfortcloud/pcomfortcloud.py", line 301, in main() File "/var/www/html/plugins/script/data/pcomfortcloud/pcomfortcloud.py", line 204, in main json_token = json.load(token_file) File "/usr/lib/python3.9/json/init.py", line 293, in load return loads(fp.read(), File "/usr/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.9/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 12 (char 11)

Maybe I missed some additional steps before?

Hi there,
Tried to import new files in my Jeedom install but seeing errors, and since I'm not an expert with code, requesting for help, thanks!

#!/usr/bin/env python3 /var/www/html/plugins/script/data/pcomfortcloud/pcomfortcloud.py -t pcomfortcloud-token email@address secret_password get 2 2>&1 returned value : 1. Détails : Traceback (most recent call last): File "/var/www/html/plugins/script/data/pcomfortcloud/pcomfortcloud.py", line 301, in main() File "/var/www/html/plugins/script/data/pcomfortcloud/pcomfortcloud.py", line 204, in main json_token = json.load(token_file) File "/usr/lib/python3.9/json/init.py", line 293, in load return loads(fp.read(), File "/usr/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.9/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 12 (char 11)

Maybe I missed some additional steps before?

you're using the old token file? that's changed.

@jensdepuydt @majurgens try now

Works as expected now. Thanks!
Documentation for usage in a Python script should also be changed with the following code instead:
import pcomfortcloud

session =<EMAIL_ADDRESS>'mypassword')
session.login()

devices = session.get_devices()

the token is not persistent anymore but only has 24h validity. after this time it needs to be refreshed - this is all taken care of by the updated library. unfortunately you will have to update your scripting too.

Thanks also to you for the solution, but you didn't answer my questions....

you can follow the git log to see the actual changes... as panasonic removed the old login workflow in favor of Oauth2, a lot of related code changes were required. wether these affect public funciton interfaces or not I am not aware.

The reason for the change in the internal structure is clear and understandable to me.
As a user of a lib, you hope for a stable external interface. That is actually the purpose of interfaces in IT architecture ;)

@jensdepuydt @majurgens try now

Works as expected now. Thanks!
Documentation for usage in a Python script should also be changed with the following code instead:
import pcomfortcloud

session =<EMAIL_ADDRESS>'mypassword', None)
session.start_session()

devices = session.get_devices()

Good suggestion, done.

./pcomfortcloud.py 'username' 'password'

That worked, great thanks, and I'm now able to get information and control the devices

@danielcherubini
You can remove the "None" then from the Readme also, ;)

@danielcherubini You can remove the "None" then from the Readme also, ;)

Having network issues with pushing today :D

@danielcherubini Question about token handling:
The lib creates a token.json, which would be valid for 24 hours.
If I have several scripts that instantiate the APIClient independently of each other, is the token shared between the scripts?

Going back to your concerns, I would much prefer to add a new method that would be like,
session = pcomfortcloud.ApiClientWithToken(token_file_location)
where you pass in a file location where you want the token to be stored... That would allow us to also store something in that tokenfile, like a version number or something, and check that, and if it differs, then throw the file out and reauth, then save a new file.

@danielcherubini Question about token handling: The lib creates a token.json, which would be valid for 24 hours.
If I have several scripts that instantiate the APIClient independently of each other, is the token shared between the scripts?
Assuming that the session is the same, ie the same logged in user.. then yes.

The scripts are located in the same directory but stateless (session is not persisted) and start with the same credentials:
session =<EMAIL_ADDRESS>'mypassword', None)
session.start_session()

I would expect that token.json is used and refreshed if needed

Then I think what you want is to be able to pass in a string to name your token.json file for each usage. That way each session has its own token.json

Then in that scenario you would use the same token file :D

Then in that scenario you would use the same token file :D

Which brings us back to my question:
If I do nothing and the scripts are in one directory, will they all share the token.json that was created in the directory?

Then in that scenario you would use the same token file :D

Which brings us back to my question: If I do nothing and the scripts are in one directory, will they all share the token.json that was created in the directory?

Correct, and as I said last time, then because they all share the same file, and contents, they would share the same session, and thus should be good for your usecase.

@danielcherubini Thanks, then let's start changing all the service scripts :)

lemme know how it goes

Looks good, the API calls just take forever ;)
The login alone takes 5s, despite the existence of token.json...
Every status query per device then another 3 s... oh dear

Can you enable more debugging?
Put True into the init,
Username, password, token, True

2024-06-24 21:10:47,805 [DEBUG   ]: Starting new HTTPS connection (1): www.appbrain.com:443
2024-06-24 21:10:48,110 [DEBUG   ]: https://www.appbrain.com:443 "GET /app/panasonic-comfort-cloud/com.panasonic.ACCsmart HTTP/1.1" 200 None
2024-06-24 21:10:48,432 [DEBUG   ]: Starting new HTTPS connection (1): authglb.digital.panasonic.com:443
2024-06-24 21:10:48,850 [DEBUG   ]: https://authglb.digital.panasonic.com:443 "GET /authorize?... HTTP/1.1" 302 737
2024-06-24 21:10:49,217 [DEBUG   ]: https://authglb.digital.panasonic.com:443 "GET //login?... HTTP/1.1" 200 None
2024-06-24 21:10:50,192 [DEBUG   ]: https://authglb.digital.panasonic.com:443 "POST /usernamepassword/login HTTP/1.1" 200 None
2024-06-24 21:10:50,611 [DEBUG   ]: https://authglb.digital.panasonic.com:443 "POST /login/callback HTTP/1.1" 302 78
2024-06-24 21:10:51,216 [DEBUG   ]: https://authglb.digital.panasonic.com:443 "GET //authorize/resume?... HTTP/1.1" 302 189
2024-06-24 21:10:51,607 [DEBUG   ]: https://authglb.digital.panasonic.com:443 "POST /oauth/token HTTP/1.1" 200 None
2024-06-24 21:10:51,629 [DEBUG   ]: Starting new HTTPS connection (1): accsmart.panasonic.com:443
2024-06-24 21:10:52,636 [DEBUG   ]: https://accsmart.panasonic.com:443 "POST /auth/v2/login HTTP/1.1" 200 121
2024-06-24 21:10:52,677 [DEBUG   ]: Starting new HTTPS connection (1): accsmart.panasonic.com:443
2024-06-24 21:10:53,628 [DEBUG   ]: https://accsmart.panasonic.com:443 "GET /device/group HTTP/1.1" 200 3036
2024-06-24 21:10:53,645 [INFO    ]: -- Login erfolgreich

That is a significant difference in behavior. The old version took care of saving the token itself, but that part is lost in the refactoring. The caller now has to take care of it.
    def login(self):
        """ Login to verisure app api """

        if os.path.exists(self._tokenFileName):
            with open(self._tokenFileName, 'r') as cookieFile:
                self._vid = cookieFile.read().strip()

            if self._raw: print("--- token found")

            try:
                self._get_groups()

            except ResponseError:
                if self._raw: print("--- token probably expired")

                self._vid = None
                self._devices = None
                os.remove(self._tokenFileName)

        if self._vid is None:
            self._create_token()
            with open(self._tokenFileName, 'w') as tokenFile:
                tokenFile.write(self._vid)

            self._get_groups()

Yes, because that part has been moved into the CLI portion of this project. That part calls the main part which is the python library part.
The reason was so that whatever called the library could have the flexiblity to deal with the token themselves.... however if you read one of my earlier posts discussing this.

Going back to your concerns, I would much prefer to add a new method that would be like,
session = pcomfortcloud.ApiClientWithToken(token_file_location)
where you pass in a file location where you want the token to be stored... That would allow us to also store something in that tokenfile, like a version number or something, and check that, and if it differs, then throw the file out and reauth, then save a new file.

One of the things @lostfields wanted was for there to be no real big changes here other than the change to authentication and i added in the separation of concerns part.
I don't think the library part should take care of save/load the token as that's not hard to take care of yourself.

that said, go check out https://github.com/sockless-coding/panasonic_cc/tree/master/custom_components/panasonic_cc/pcomfortcloud
That's been updated far more than this one has... and there's now a good deal of testing done there.

+1 from me. this separation allows users of this library to store the token data however/wherever they need, for example in a database, in memory or in a file or not at all. not every systems might have access to file storage.

I don't think the library part should take care of save/load the token as that's not hard to take care of yourself. I am open to debate here.

I didn't say it was wrong, I just said it was an unexpected change...
I'm also only using the lib, not the CLI part, but in the old version it was centralized and not every script has to take care on its own ;)
So, yes, that would be a solution:

session = pcomfortcloud.ApiClientWithToken(token_file_location)

The method name also suggests that a token content should be passed. ;)
Furthermore, shouldn't the username/password still be passed? What happens the first time it is called? Or when the refresh token has expired?

The login alone takes 5-7s, despite the existence of token.json...
Every status query per device then another 3 s

Just documenting what I see. This is just the new normal.
I am seeing the login normally take 4.8 to 5.2 seconds
I am seeing a status query take as low as 1.8s, normally 2.2s and sometimes up to 3s
Before it generally took 2-2.5s for everything

The login alone takes 5-7s, despite the existence of token.json...
Every status query per device then another 3 s

Just documenting what I see. This is just the new normal.
I am seeing the login normally take 4.8 to 5.2 seconds I am seeing a status query take as low as 1.8s, normally 2.2s and sometimes up to 3s
Before it generally took 2-2.5s for everything

Login is now much more complex, its multiple calls instead of one. Sadly that's just the way it is now.
The API calls, the regular ones have not been touched. So if it takes longer now, that's on Panasonic's end.

with the Oauth2 tokens, the login part only needs to be done once. after this, the Bearer token can be used directly so you only get the real api latencies. the bearer token is only valid 24h, but can be refreshed with the refresh token, which will add some extra latency but not as much as an entire login process.

Hi guys,
Sorry for noob questions, but is the token supposed to be refreshed automatically? Because I'm getting these errors:
pcomfortcloud.exceptions.ResponseError: (get_groups: Expected status code 200, r                                                                                eceived: 401: {"code":"4100", "message": "Token expires"}

@danielcherubini in the 1.21.0 android app, request headers to accsmart.panasonic.com are all lowercase now. their values did not change though

Thanks for that @heldchen

@danielcherubini in the interests of getting this working again for everyone don’t have any objection to @lostfields reworking this (see https://github.com/lostfields/python-panasonic-comfort-cloud/issues/98#issuecomment-2290736711 )


Merged cells are not copied when copying worksheets

Suppose I have worksheet1 which contains some merged cells.
If I do
let worksheet2 = workbook.addWorksheet('Sheet2');
worksheet2.model = worksheet1.model;

worksheet2 will not have the same merged cells as worksheet1.
The problem seems to be the use of a wrong variable in _parseMergeCells of worksheet.js, specifically on line 523, where model.mergeCells is used instead of model.merges.

While waiting for the fix
worksheet2.model = Object.assign(worksheet1.model, {
  mergeCells: worksheet1.model.merges,
});

Faced same problem while merging excels containing embedded objects or emf files.
Had to move aspose package of java.

While waiting for the fix
worksheet2.model = Object.assign(worksheet1.model, {
  mergeCells: worksheet1.model.merges,
});

it seems model.merges cannot be found in the WorkSheet object.
any update on this?

Hi, I am facing a similar issue, when copying rows, rows merged cells are not copied over. Any help on this would be really great, Thanks.

Hi @jontey, i am facing a similar issue, i am on the latest version, can you please let me know in what version your fix worked? may be i can try on that version, thanks.

While waiting for the fix
worksheet2.model = Object.assign(worksheet1.model, {
  mergeCells: worksheet1.model.merges,
});

Still working like a charm! Cheers!

I took the _merges from the original worksheet
And performed the merge on the destination worksheet.
The layout of border will collapse,
but if you devise it on the template file side, you can do it somehow
const copyWorkSheet = (workbook:ExcelJS.Workbook,srcSheetName:string,newSheetName:string) => {
  const srcSheet = workbook.getWorksheet(srcSheetName);
  let cloneSheet = workbook.addWorksheet('Sheet');
  cloneSheet.model = srcSheet.model
  _.each(srcSheet._merges,merge=>{
    cloneSheet.mergeCells(merge.top,merge.left,merge.bottom,merge.right)
  })
  cloneSheet.name = newSheetName
}

Hello,
I faced this issue as well, I also wanted to add rows and keep the merging model at the same time.
Adding a new row also breaks the merging model of the rows underneath.
So, I ended up not using merged cells, rather centering data horizontally on multiple cells: https://kb.wisc.edu/helpdesk/page.php?id=119089

I had the same problem but others answers didn't worked well for me.
Copying array from source to target does not work, I had to call the mergeCells() function for each merged cells instead.
Hereafter my solution which seems OK with exceljs 4.4.0 :
public duplicateWorksheet(workbook: ExcelJS.Workbook, workSheetIndexOrName: number | string, name: string): ExcelJS.Worksheet {
    const sheetToClone = workbook.getWorksheet(workSheetIndexOrName);
    const cloneSheet = workbook.addWorksheet("Sheet");
    cloneSheet.model = { ...sheetToClone.model };
    cloneSheet.name = name;
    sheetToClone.model.merges.forEach(merge => cloneSheet.mergeCells(merge));

    return cloneSheet;
  }


Create Data.py

Data Fetch from S3 generally it contains a dump in compressed format,so we can get direct dataframe, out of excel,json or csv

We should also include file where all the files are merged so that CSV can also be included for further process


Add good message

Add a good message for tasks that are not on the bad list

Could you add a checkbox that defaults to False to enable the good message? So that current users won't have an unexpected change when the plugin updates.

Absolutely, done :)

Looks good, I'll double check that it works properly once I have access to a computer

I appreciate why you've renamed the message key to badMessage, unfortunately I think this would cause existing plugin users to lose their custom messages. I'd prefer if you could change the keyName back to message to avoid this.

Great point I definitely don't want to change the experience for any existing users. I reverted the key name back to message


Double name removal

Remove double name and exclude name from displaying in stats.

ON load dropped Player column so it no longer shows as a stat


⚠ Ixtanet SAT has degraded performance

In 42bb34d, Ixtanet SAT ($MEDIA_SAT) experienced degraded performance:

HTTP code: 200
Response time: 22089 ms

Resolved: Ixtanet SAT performance has improved in c37d389.


[Bug] Dependency injection fails when multiple routes share the same name

Describe the bug
If multiple route handlers have the same name, sanic-ext will treat them as one route during dependency injection, causing a HTTP 500 because passed kwargs does not correspond to the function signature.
Screenshots

To Reproduce
Consider this code:
from sanic import Sanic, response

app = Sanic('test')

class Object:
    pass

app.ext.add_dependency(Object, lambda req: None)

@app.route('/foo')
def handler(req, foo: Object):
    return response.text('foo')

@app.route('/bar')
def handler(req, bar: Object):
    return response.text('bar')

app.run(debug=True)

Then visit /foo. It shows a HTTP 500 error:
Traceback (most recent call last):
  File "handle_request", line 81, in handle_request
    error_logger,
TypeError: handler() got an unexpected keyword argument 'bar'

Expected behavior
I'm not sure whether it is discouraged to use a same name (handler in the example above) across different route handlers.
I believe sanic-ext should either support this or warn users about this caveat.
Environment (please complete the following information):

OS: Windows 10 (19044.1466)
Browser: not related
Version: sanic 21.12.1, sanic-ext 22.1.2

Additional context
Maybe the signature_registry should use something else as the key.

This is discouraged for sure. It probably should be a warning by the core project.

I surveyed the Sanic docs for a while before posting this issue, and I wonder whether duplicate route names are really discouraged.
Here are some findings:

The API doc for Sanic.route says that the name is an Optional[str] as a "user defined route name for url_for". It suggests that a unique name is optional and only needed by url_for.
The Sanic user guide itself heavily uses handler as the function name, which is not unique.
It actually works perfectly fine if handler names are not unique.

By comparison, Flask said in its API doc that endpoint names should not duplicate, and it raises AssertionError: View function mapping is overwriting an existing endpoint function: handler before server startup if the developer really violates this.
So if you are sure that handler names must be unique in Sanic, I would suggest a warning both in the user guide and in the Sanic code.

url_for is the only place the core project uses it. However, we've been moving towards pushing naming in Apps and Blueprints for several years now. In last LTS (for example) strict enforcement is enabled for app and blueprint naming. This is part of that shift.
It uses handler because that's fairly descriptive for what it is. AFAIK it does not use two similarly named functions in the same example. If it does we should fix that.
Yes, it works, which is why we have not broken that and do not have a current plan to. I'd like to strictly enforce, but there has not yet been a need to push that. Other python tools like flake8 will yell at you for this.
What Flask does is fairly irrelevant and would not sway my opinion in either direction.
There is not currently a unique naming requirement. I would like to enforce that, but we are several release cycles away from being able to do that.

With that all said, we probably should add the warning to 21.3 and aim for enforcement by the end of the year.


Option to let quickfix add import statements in top cell

Discussed in https://github.com/microsoft/vscode-jupyter/discussions/11313

Originally posted by yuuuxt September  6, 2022
Currently the quickfix only adds import statement on top of the current cell.
Is there an option that can let quickfix always add import statements to the top cell?

Maybe adding an extra selection step is a good idea:

(current) quick fix - select the import statement;
(to add) - select to insert in current cell or in a top cell

The order of the 2 options can be swapped, then whatever the user prefers, most of the time the user only needs to hit enter twice without thinking.


Liorkesten/unittests and metrics

Added unit test
Improve ARG query performance.
Added metrics
Added pagination for ARG

נו נונ נ


Reorganize Logical/Ordinal Hierarchy

Subtasks

[ ] #419
[ ] #420

Our Symbolic logical & ordinal class hierarchy is very general in these ways

It is "polymorphic" across both Haskell's logic and Symbolic's logic
It is rebindable, so that if then else syntax can be used by Symbolic users

We should therefore move it from ZkFold.Symbolic.Data to somewhere within ZkFold.Base. Using our classes more thoroughly instead of Prelude's offers more chances to reuse code between Haskell & Symbolic.
Additionally, in #396 I added a type family BooleanOf depending on an EllipticCurve type. That was just a stopgap as this type family properly belongs together with the logical hierarchy, not with elliptic curves.
Proposed logical hierarchy
class Boolean b where
  true, false :: b
  not :: b -> b
  (&&), (||), xor :: b -> b -> b

class Boolean (BooleanOf a) => Conditional a where
  type BooleanOf a :: Type
  bool :: a -> a -> BooleanOf a -> a

class Conditional a => Eq a where
  (==), (/=) :: a -> a -> BooleanOf a

If we did the same thing for the ordinal hierarchy it may look like this
class IsOrdering o where
  lt, eq, gt :: o

class IsOrdering (OrderingOf a) => HasOrdering a where
  type OrderingOf a :: Type
  ordering :: a -> a -> a -> OrderingOf a -> a

class (HasOrdering a, Eq a) => Ord a where
  compare :: a -> a -> OrderingOf a

For Haskell types, OrderingOf a ~ Prelude.Ordering. For Symbolic types, we can define an ordering type just like the definition of a boolean type:
newtype Ordering c = Ordering (c Par1)
instance Symbolic c => IsOrdering (Ordering c) where
  lt = Ordering $ embed (Par1 (negate one))
  eq = Ordering $ embed (Par1 zero)
  gt = Ordering $ embed (Par1 one)

All of the usual Ord methods are recoverable as default implementations from ordering and compare.
Generic default implementations for logical classes should be maintained and should be added for ordinal classes too.

Totally agree about moving it to base (ZkFold.Base.Data.{Boolean,Conditional,Eq,Ord} look like good names) and about the logical hierarchy.
For ordering hierarchy -- agreed about introducing the Ordering newtype and having compare in the minimal definition.
Adding IsOrdering and HasOrdering has no immediate usecases, but surely helps in building the analogy.
I'd also add ways to convert OrderingOf a to BooleanOf a to the IsOrdering interface however to immediately have default implementations for (<=/</>/>=) in the general Ord class.

Note about conversions from OrderingOf a to BooleanOf a:
Thanks to optimizations introduced by @hovanja2011, symbolic booleans are quite efficient in terms of constraints: constants cost exactly 0 constraints, and after #399 gets merged, boolean negation would also cost 0 constraints. So from efficiency viewpoint, adding Eq o as a superclass constraint to the IsOrdering o constraint is enough (from this we get x < y = compare x y == lt, and from this all the other comparisons can follow).

IsOrdering simply abstracts over Haskell & Symbolic ordering types but it probably makes sense to merge HasOrdering into Ord.

Hmm, I think it's fine as is, let's keep it to mirror Conditional

Looks good to me! Should we add different comparison operations to the class definition as well for efficiency? Also, maybe add ifThenElse as well.

Should we add different comparison operations to the Ord class definition for efficiency?

Yes, we should definitely include standard comparison & max & min operations with default implementations (which should be optimized by constraint number).

Also, maybe add ifThenElse as well.

ifThenElse b t f = bool f t b so you don't gain much by promoting it from a function to a method to Conditional.

Default implementations of Ord methods using only compare and ordering:
class (HasOrdering a, Eq a) => Ord a where
  compare :: a -> a -> OrderingOf a
  (<), (<=), (>), (>=) :: a -> a -> BooleanOf a
  x < y = ordering true false false (compare x y)
  x <= y = ordering true true false (compare x y)
  x > y = ordering false false true (compare x y)
  x >= y = ordering false true true (compare x y)
  max, min :: a -> a -> a
  max x y = ordering y x x (compare x y)
  min x y = ordering x x y (compare x y)

This would need HasOrdering (BooleanOf a), too, I guess?

I expect we will want to include these ^ constraints and more on BooleanOf a and on OrderingOf a.

We should also have the constraint Monoid (OrderingOf a), the "lexicographical" operation with
lt <> _ = lt
gt <> _ gt
mempty = eq

* `Eq a` should imply

  * `Eq (BooleanOf a)`
  * `BooleanOf (BooleanOf a) ~ BooleanOf a`

Oof, loopy superclasses... It would be ok if the places where this might break were only inside our code, but if we're going to expose these classes to the users, their code might become hard to debug too.

Btw I think at least Eq classes as defined here should help in simplifying IVC code a bit. @vlasin, am I right?

Oof, loopy superclasses...
I don't think the error messages would be bad but if you find it more elegant we can leave out these implications and minimally add what's needed in the signatures for default implementations for Ord comparison operator methods.

Btw I think at least Eq classes as defined here should help in simplifying IVC code a bit. @vlasin, am I right?

What do have in mind?

What do have in mind?

I remembered that in @vks4git's first attempt at Protostar, there were needed something like Eq (Bool ctx) (c, f, (f, c, f), f) to simplify the logic in the verifier. Thanks to your refactorings, we don't need this constraint but I guess we pass this kind of a tuple around (do we? don't remember actually). Thanks to generalized Eq, we can still not depend on Symbolic directly and have a simpler code

I don't think the error messages would be bad but if you find it more elegant we can leave out these implications

Actually I took a look at the documentation for UndecidableSuperClasses and this actually looks like an intended usecase, so the errors should be fine.

One thing is though, I think it will be better to have 1 module for all of the logical hierarchy classes instead of 3 modules.

Why is that so?

^ Because they're all related so it's easier for development and it's not that much code that the benefit of modularization is high. It's not that strong a preference for me and it seems the balance of views is against mine so.

In the elliptic curve hierarchy proposal #411 I argued that making the classes be multiparameter would let us instantiate a given curve with different choices of fields. But with this proposal I did the opposite and changed the Conditional and Eq classes to be single parameter with an associated BooleanOf type family. But now I'm thinking the same motivation for field parametricity applies to booleans as well. In particular, any symbolic type is conditional with either Haskell or Symbolic Bool.
@vlasin @TurtlePU What do you think?

I answered in the other issues. For SymbolicData types, the context is uniquely determined as Context x. Therefore, we have the boolean type as Bool (Context x). For the Interpreter context, we care about time performance, so we might want to write custom instances, e.g., for Vector, if it speeds up the computations.

For SymbolicData x it is certainly true that Bool (Context x) is the correct boolean for symbolic computation including conditional and equality operations. However, it is also perfectly valid to use Prelude.Bool for Haskell conditional operations involving x. That is, both of these multiparameter instances will make sense for a symbolic datatype.
data Foo c = ..
  deriving Generic
instance Conditional Prelude.Bool (Foo c) where
  bool = Data.Bool.bool
instance Symbolic c => Conditional (Bool c) (Foo c)

The general idea that I propose to follow is that if there are several options of one type parameter corresponding to the same value of another type parameter, then multi-parametric type classes are justified.

That is why I'm questioning whether an associated type family BooleanOf is appropriate.
While the symbolic Bool is arguably the "right one", and we always have the option to use Data.Bool.bool, which indeed is done in at least one algorithm in our codebase, according to your general idea, we should consider maintaining multiparameter logical typeclasses as they stand.

instance Conditional Prelude.Bool (Foo c) where
bool = Data.Bool.bool

Well, while this instance is valid, there is no gain from introducing it. We can use if/bool from Prelude as is. That's what I meant.

Noticed that these classes can also be incorporated into main Numerical hierarchy like this:
class (Eq a, ...) => Field a where ...
class (Ord a, ...) => SemiEuclidean a where ...

This would allow for cleaner formulation of laws and streamline the hierarchy.


Convert Project to Kotlin

Is your feature request related to a problem? Please describe.
Kotlin is our primary language but 40% of the codebase is still in java, this ticket aims to get that number to 0%. If you want to contribute to the project but are finding it diffcult to find a suitable ticket of a manageable size then this is for you!
Describe the solution you'd like
Comment here that you want to convert a class (I recommend starting with small ones) with the class name to claim it. Then make a ticket and start working on it. Use ctrl+alt+shift+k to automatically convert the file and then improve it to be more idiomatic kotlin.
Additional context
If you have never worked in kotlin before the koans (and the kotlin docs in general) are a good way to get used to the features. There is also support from kiwix members if you want to open a PR in draft

Hi, I can convert the Java class into kotlin.

And I am addressing one issue. Why you have used CoroutineScope for setting an Adapter?

And I am addressing one issue. Why you have used CoroutineScope for setting an Adapter?

This is for the future purpose because it will need heavy work.so I used CoroutineScope and  Dispatcher.Default thread to do that heavy work.

Hi, I can convert the Java class into kotlin.

@abkoradiya Please make sure to open a ticket that you want to convert java class to kotlin.

And I am addressing one issue. Why you have used CoroutineScope for setting an Adapter?

This is for the future purpose because it will need heavy work.so I used CoroutineScope and  Dispatcher.Default thread to do that heavy work.

But setadapter need to be call on main thread right? So why it is required to right main thread work on Dispather.Main?

Dispather.Main is the android's main thread. In the Coroutines world that's how you change the thread.

Dispather.Main is the android's main thread. In the Coroutines world that's how you change the thread.

I know already. But Is that any meaning to write main thread work on Dispatcher.Main thread without changing any thread?

Yes, That's unnecessary.

So Do I need to create new issue and pull request for every java class one by one?

yes. that will be fantastic.

In which branch code, I need to work?

You need to create a sperate branch for a separate issue then you should make a pull request. For more info, you can find here

I have found 4 class which is in java.
MyContentProvider
TaskContract
TaskDbHelper
DownloadActivity.
But this classes is not used anywhere.

Use the class which is used
On Sun, Oct 4, 2020, 17:32 Abhay Koradiya<EMAIL_ADDRESS>wrote:

I have found 4 class which is in java.
MyContentProvider
TaskContract
TaskDbHelper
DownloadActivity.
But this classes is not used anywhere.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/gouri-panda/XPlayer/issues/10#issuecomment-703245435,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKMOWYX52M5SC45Z7NF3AIDSJBP35ANCNFSM4SDSPYWQ
.

But no other java class I found which is used.

only four class in searching and it is not used.

DownloadActivity is perfect for converting java to kotlin.

Hi, I have pushed changes to dev branches on my fork.

Can I create pull request now?

Ok but ideally it is not OK to push from main brach.Main branch should be
clean.
On Sun, Oct 4, 2020, 17:54 Abhay Koradiya<EMAIL_ADDRESS>wrote:

Can I create pull request now?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/gouri-panda/XPlayer/issues/10#issuecomment-703247958,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKMOWYQKZWSASLHGNTHL6GLSJBSP3ANCNFSM4SDSPYWQ
.

Ok but ideally it is not OK to push from main brach.Main branch should be clean.
…
On Sun, Oct 4, 2020, 17:54 Abhay Koradiya @.***> wrote: Can I create pull request now? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#10 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMOWYQKZWSASLHGNTHL6GLSJBSP3ANCNFSM4SDSPYWQ .

I have push changes on dev branch. not in master branch,

check here > https://github.com/abkoradiya/XPlayer/tree/dev

@abkoradiya you should check this firstHacktoberfest presented by DigitalOcean

@abkoradiya you should check this first

Hacktoberfest presented by DigitalOcean

Have watched. But not found related this.

The video is telling the proper way to create a pull request.Please follow this procedure.

Ok, I think you have referenced the wrong video. I am watching the right one In the beginner section.


npm install enduro -g errors

C17PN8T6G8WN:enduro xjxh209$ npm install enduro -g
npm WARN deprecated<EMAIL_ADDRESS>Use uuid module instead
npm WARN deprecated<EMAIL_ADDRESS><EMAIL_ADDRESS>is no longer maintained. Upgrade to<EMAIL_ADDRESS>npm WARN deprecated<EMAIL_ADDRESS>graceful-fs version 3 and before will fail on newer node releases. Please update to<EMAIL_ADDRESS>as soon as possible.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "enduro" "-g"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code E404
npm ERR! 404 no such package available : @gulp-sourcemaps/identity-map
npm ERR! 404
npm ERR! 404  '@gulp-sourcemaps/identity-map' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'gulp-sourcemaps'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

That's weird, right? Could you run npm -v and node -v for us?

C17PN8T6G8WN:enduro xjxh209$ npm -v
3.10.10
C17PN8T6G8WN:enduro xjxh209$ node -v
v6.10.3

Install does not complete, it just stops with zero errors. One odd result is that the cursor in my PuTTY window disappears, but I am still able to type and run commands. The output of "sudo npm install -g enduro":
$ sudo npm install -g enduro
npm WARN deprecated<EMAIL_ADDRESS>Use uuid module instead
npm WARN deprecated<EMAIL_ADDRESS>Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated<EMAIL_ADDRESS>Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated<EMAIL_ADDRESS>graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to<EMAIL_ADDRESS>as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
Killed          ...] \ extract:svgicons2svgfont: sill gunzTarPerm modified mode [ 'ts/rx.joinpatterns.d.ts', 384, 420 ]
Any thoughts or ideas?
Thanks :)

Oops, forgot this:
$ node -v
v6.11.0
$ npm -v
3.10.10

Nevermind, my issue turned out to me that my VPS ran out of memory.

Closing issue as its now fixed as above


fix: Make auto-type field in filter optional (as in strawberry_django)

I've just copied the strawberry_django code where it check if an auto-type should be optional or not.
Since there is no tests on schema, I'm not able to write test for this.
This PR fix #55
As a side note: I saw a lot of code difference between strawberry_django and strawberry-django-plus in type._process_type and type.get_fields methods. I think strawberry-django-plus should use more of strawberry_django on theses parts

Hey @fabien-michel ,
Thanks for the PR. It seems that the tests broke when checking for pyright issues. Can you check them?

As a side note: I saw a lot of code difference between strawberry_django and strawberry-django-plus in type._process_type and type.get_fields methods. I think strawberry-django-plus should use more of strawberry_django on theses parts

The changes are to support some of the peculiarities from this lib, and it also has some fixes and improvements on top of type._process_type and type.get_fields. Most of it will soon be merged into strawberry-graphql-django

Oops I thought check pyright was happy.
I give up, I didn't understand enough what is required here to be sure to write a good patch.


Target="_blank" rel="norefer" ?

Shouldn't we use y links Target="_blank" rel="norefer" ?

Can you add more details here ? Most component have target blank already, and  button does support the rel attributes

By default, target blank is set for all email links. Google's safety recommendations say that for such a case, rel nooper noreffer should be added by default. Is this an obligation to apply to letters as well?

@GurovDmitriy Could you link to those recommendation?

https://web.dev/external-anchors-use-rel-noopener/

You can still provide default value to any rel attribute with mj-all. I'm closing it

You can still provide default value to any rel attribute with mj-all. I'm closing it


Fuzzy completion not using FZF_DEFAULT_COMMAND?

Category

[ ] fzf binary
[ ] fzf-tmux script
[ ] Key bindings
[x] Completion
[ ] Vim
[ ] Neovim
[ ] Etc.

OS

[x] Linux
[ ] Mac OS X
[ ] Windows
[ ] Windows Subsystem for Linux
[ ] Etc.

Shell

[x] bash
[ ] zsh
[ ] fish

I am trying cd ** while in home, but all my results are from .dropbox/* or .wine/*, and I'd like to exclude them. I tried export FZF_DEFAULT_COMMAND='rg --files --no-hidden --follow' with no luck. Any tips? thx!

I think you need to use _fzf_compgen_path instead :
In the source code :
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
if ! declare -f _fzf_compgen_path > /dev/null; then
  _fzf_compgen_path() {
    echo "$1"
    command find -L "$1" \
      -name .git -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
      -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
  }
fi

I just had the same problem. Just saw in the docs that this exists FZF_CTRL_T_COMMAND=. Wow didn't use it all this time and I thought I had set it up correctly.
# Feed the output of fd into fzf
fd --type f | fzf

# Setting fd as the default source for fzf
export FZF_DEFAULT_COMMAND='fd --type f'

# Now fzf (w/o pipe) will use fd instead of find
fzf

# To apply the command to CTRL-T as well
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

Is this the same for Alt c? Which begs the Q what IS FZF_DEFAULT_COMMAND if it's not picked up by the fzf cli?

Ditto for alt-c command. Its ignoring all my git submodules. I added skip vcs options to fzf_default_command. Whats the point for a default command if it's not used?

@rileyrg See https://github.com/junegunn/fzf#key-bindings-for-command-line
FZF_DEFAULT_COMMAND is supposed to list files, while ALT-C needs a list of directories. Fuzzy completion cannot use FZF_DEFAULT_COMMAND because you want different results depending on the prefix (e.g. ls ~/dir1/** vs. ls ~/dir2/**) and a static command defined in FZF_DEFAULT_COMMAND cannot satisfy the requirement.

May I ask how I get alt c to look through hierarchies of git directories. I've obviously missed something really easy as it must be straightforward.


Continuous Integration with OAuth is failing

https://github.com/NationalSecurityAgency/skills-service/runs/3671712233?check_suite_focus=true

PR: https://github.com/NationalSecurityAgency/skills-service/pull/858


Fixed whitespace detection issue with tests

Fixes #1496
@astronomersiva this converts the &nbsp character into a space. I think this is a decent fix, because people generally should be using   in html. Let me know if you disagree.

In HTML, I could see an argument for keeping a &nbsp character or changing it to   as it can technically change the layout, even though it is certainly bad style.

In HTML, I could see an argument for keeping a &nbsp character or changing it to  …

I don't know the details of this pull request; I'm only commenting because I'm participating in #1495.

There is nothing wrong with the U+00A0. It is necessary in many instances, e.g. to prevent icon+menu items from wrapping. Please never, ever change U+00A0 to a normal space character! This is corrupting content, and is the worse thing you could do.
Please do not change U+00A0 to  . While this named character reference is guaranteed to be recognized as HTML, if the source file is XML-based (e.g. XHTML) then it will break parsing because in XML all entities other than the predefined entities must be defined in an internal or external XML DTD.

So please no workarounds that involve mucking with the content. Leave the content as it is!!! A non-breaking space should be formatting according to the semantics: i.e. don't wrap on a non-breaking space.

@garretwilson
Okay, so being strict and accurate with the whitespace detection in HTML matters.  Good to know.  Great user-feedback as always.
@MacKLess  It looks like the HTML tokenizer will need to specifically only match "space characters"
as noted in https://www.w3.org/TR/html5/infrastructure.html#space-characters when separating words. All other characters will need to be treated as text.

It looks like the HTML tokenizer will need to specifically only match "space characters" …

I saw the preview of your comment come up in my email, so I was going to paste the link to https://www.w3.org/TR/html52/infrastructure.html#space-characters and then I see you already found it. 😆
So 👍 !

Okay, so being strict and accurate with the whitespace detection in HTML matters.

"… being strict and accurate … matters." Thought of the day. 😉

There is I suppose the question of whether you should wrap on characters that Unicode has marked as "whitespace" in the Unicode Character Database. For example the MEDIUM MATHEMATICAL SPACE character U+205F is marked as Unicode "whitespace". The problem with wrapping on Unicode whitespace characters is the same one as NBSP: when you wrap, I presume js-beautify would replace the character with a newline (and perhaps tabs). The problem is that doing so would result in removal of this character with special semantics. The other option would be to keep it and still wrap, which would result in the addition of ASCII whitespace that wasn't there before.
So after this short little conversation with myself 😆 I think my earlier conclusion (and that of @bitwiseman ) is the correct one: only wrap on the characters HTML5 considers whitespace, and we'll all be happy.
Thank you for bearing with this brief interlude. 😉


Enhance sync user guide

Following the conversation here: https://github.com/danschultzer/pow/issues/231 .
Don't hesitate to tell me anything that can improve my PR.
Thanks

Thanks, looks good! I've updated with a plug module example, and detailed the caveat with updating the cached credentials through a background task as discussed in #231. Wdyt?

That's fine for me. It's more clear now. Thanks for the update @danschultzer ! 😀


az artifacts universal download fails on macOS

I have installed az-cli on my macOS 10.14.3 system with:
$ brew update && brew install azure-cli
$ az extension add --name azure-devops
Then successfully logged in with
$ az login
When I want to download a universal artifact from my Azure Devops account with:
$ az artifacts universal download --feed "XXX" --name "YYY" --path . --version "###" --org "https://dev.azure.com/zzzzzz/"
The binary is being downloaded, but then I get the following errors (reproducible on two different machines):
 [GetBuildDropManagerAsync] Try 1/5, retryable exception caught. Retrying in 00:00:01. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [GetBuildDropManagerAsync] Try 2/5, retryable exception caught. Retrying in 00:00:02.0460000. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [GetBuildDropManagerAsync] Try 3/5, retryable exception caught. Retrying in 00:00:04.4350000. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [GetBuildDropManagerAsync] Try 4/5, retryable exception caught. Retrying in 00:00:07.7130000. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [GetBuildDropManagerAsync] Try 5/5, retryable exception caught. Retrying in 00:00:13.2850000. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [GetBuildDropManagerAsync] Try 6/5, retryable exception caught, but retries have been exhausted. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? Encountered an unexpected error. Microsoft.VisualStudio.Services.Common.VssServiceException: TF400813: The user 'GUID\my-email-address' is not authorized to access this resource.    at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)    at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)    at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)    at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState)    at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken)    at Microsoft.VisualStudio.Services.WebApi.Location.LocationService.CreateDataProviderAsync(String location, CancellationToken cancellationToken)    at Microsoft.VisualStudio.Services.WebApi.Location.LocationService.ResolveLocationDataAsync(Guid locationAreaIdentifier, CancellationToken cancellationToken)    at Microsoft.VisualStudio.Services.WebApi.Location.LocationService.GetLocationDataAsync(Guid locationAreaIdentifier, CancellationToken cancellationToken)    at Microsoft.VisualStudio.Services.WebApi.VssConnection.GetClientInstanceAsync(Type managedType, Guid serviceIdentifier, CancellationToken cancellationToken, VssHttpRequestSettings settings, DelegatingHandler[] handlers)    at Microsoft.VisualStudio.Services.WebApi.VssConnection.GetClientServiceImplAsync(Type requestedType, Guid serviceIdentifier, Func4 getInstanceAsync, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssConnection.GetClientAsync[T](CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Content.Common.AsyncHttpRetryHelper1.InvokeAsync(CancellationToken cancellationToken)    at ArtifactTool.BuildDropManagerProvider.GetBuildDropManagerAsync(String serviceUrl, String patVar, ILogger commandBaseLogger, IAppTraceSource tracer, CancellationToken cancellationToken)    at ArtifactTool.Commands.UPackDownloadCommand.ExecuteAsync()    at ArtifactTool.Commands.CommandBase.OnExecuteAsync()    at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments)    at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context)    at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass126_0.<OnExecute>b__0()    at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](CommandLineContext context)    at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context)    at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](IConsole console, String[] args)

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: fa27bc14-1989-60eb-06ea-1270d9fbf0f1
Version Independent ID: 1f391f98-ac28-ba9f-366a-447c1f9e4feb
Content: az artifacts universal
Content Source: latest/docs-ref-autogen/ext/azure-devops/artifacts/universal.yml
GitHub Login: @rloutlaw
Microsoft Alias: routlaw

Just tested on Windows 10, same results.

@gauravsaralMs could you take a look?

@mitchdenny @zarenner: can you please take a look?

ack. I've shared it with our DRI to look into. @Pegolon. Could you create a new feed and try uploading a package to it?

Update azure-cli to 2.0.60, extension azure-devops still version 0.3.0, created new feed, created new artifact on feed from build pipeline, unfortunately the error messages stayed the same.

So the error you are getting is coming from a build pipeline? Or the pipeline succeeded to publish and you couldn't download. Is your Pipeline running on a hosted agent?
I'm suspecting an authn/authz issue here. Can you try doing an az login again?

No, on Azure DevOps web interface I can create the artifact and upload it to the feed. It is listed there and looks ok. However with the command line tools I cannot download it. az login always succeeds. I am using the admin user which created the feed and manages the build pipelines, so permission should not be a problem.

When you say you create the artifact and upload it on the web-interface  what do you mean? The only way to upload Universal Packages is via the Azure CLI or via a Azure Pipelines.

Sorry for being unprecise: of course the artifact is being created by the build pipeline. My main problem is that I cannot download it. Background: I am building a macOS framework and putting it in an artifact which I want to use in other projects. I thought the command line tools would let me download it directly, since I need it during development, but then later also when building the final app. So my main problem, as the subject of this issue states is with "download".

Hi @Pegolon , A quick question, in your build pipeline, which task are you using to upload - Universal packages or Publish Pipeline Artifact?? This will help us reproduce on our end.
P.S - I think the subject should not have "Mac OS" as the issue is reproducible on Windows as well.
Thanks,
Tanmay

@fadnavistanmay I added "Mac OS" to the title since I discovered the problem there first. Removed it now from the subject.
This is my pipeline task for uploading the artifact:

task: UniversalPackages@0
displayName: Publish framework
inputs:
command: publish
publishDirectory: '$(Build.BinariesDirectory)/Build/Products/Release/MyCustom.framework'
vstsFeedPublish: 'MacOS'
vstsFeedPackagePublish: 'macos.mycustom.framework'
versionOption: custom
versionPublish: '$(framework_version).$(Build.BuildId)'
packagePublishDescription: 'Self-contained framework containing dotnet core runtime'

Thanks @Pegolon . I am trying to repro this. Is there a reason you are using az cli to download, to unblock can you try using the UniversalPackages Download task to download.?
Thanks,
Tanmay

I want to use both: while developing I want to use the CLI to download the framework, when building on a pipeline during CI/CD I want to use the download task. That way I can reduce the complexity that CocoaPods brings to the table and I have a prebuilt binary framework available and don't need to check it into a separate repository.

@Pegolon I think we are going to need to transition to e-mail to exchange a few detailed logs so we can try and track this down. Can you e-mail me on midenn at microsoft.com and I'll get you connected directly to the engineers and we can talk about getting Fiddler traces etc.

@mitchdenny I finally got it working. Set up a new project, migrated my source from the old project, built the framework and upload it successfully. After that "az artifacts universal download..." from the commandline did not complain anymore and it downloaded the package. Not really sure what is different now.

I had same problem when uploading/downloading from old-organization-URL ... may be the problem is related to the old URL-style ...

I'm having this problem as well. I'm on Windows 10 running the latest version of the azure-cli (2.0.62) and azure-devops (0.4.0).
az artifacts universal download --feed "my-feed" --name "myartifact" --path "C:\Users\X\Desktop\" --version "1.0.0" --org "https://dev.azure.com/myname"
I get the exact same error as Pegolon:
Universal Packages is currently in preview. [VerifyConnectionAsync] Try 1/2, retryable exception caught. Retrying in 00:00:01. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [VerifyConnectionAsync] Try 2/2, retryable exception caught. Retrying in 00:00:02.1070000. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [VerifyConnectionAsync] Try 3/2, retryable exception caught, but retries have been exhausted. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? Encountered an unexpected error. Microsoft.VisualStudio.Services.Common.VssServiceException: TF400813: The user<EMAIL_ADDRESS>is not authorized to access this resource. ..... .....
I have tried creating an entirely new organization with an entirely new Artifacts feed, I've tried using both az login and az devops login with the same results. If I intentionally login to a different azure account which does not have access to the resource, I get a one-line sensible error that my user is not authorized to access this resource, but without the large exception dump.
Furthermore, using the VSTS CLI equivalent of this, which has almost the exact same parameters works great. I was able to upload and download universal files using the VSTS CLI, and have tried downloading those with az artifacts universal and uploading new files, but all with the same results.

I'm having this same issue. I was having a different issue of an access denied when trying to install the artifacttool but now I am having this issue.  Any suggestions? Trying to download.

Our main issue so far has been the already reported issue of artifacttool not using the proxy variables correctly. Be defined in various forms in windows environment, via network configuration, etc. With debug, we can see the transition from vsts cli to artifact tool hang making a secure request. Running from off network is not an option as security requires us to be on network in order to connect to vsts.

@geverghe - Could you please look into this. This feels like an issue with the credential store and how the az cli is accessing it?
Thanks

Looping in @gauravsaralMs to investigate.

@fadnavistanmay : can you please share the logs to point that this is an issue with credential store? and can you also share the repro steps for the same?

Hey guys ... same issue on Windows10

Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called

Any idea for workaround?

Great, it worked also for me:
az logout
az devops login

I'm having this problem as well. I'm on Windows 10 running the latest version of the azure-cli (2.0.62) and azure-devops (0.4.0).
az artifacts universal download --feed "my-feed" --name "myartifact" --path "C:\Users\X\Desktop\" --version "1.0.0" --org "https://dev.azure.com/myname"
I get the exact same error as Pegolon:
Universal Packages is currently in preview. [VerifyConnectionAsync] Try 1/2, retryable exception caught. Retrying in 00:00:01. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [VerifyConnectionAsync] Try 2/2, retryable exception caught. Retrying in 00:00:02.1070000. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? [VerifyConnectionAsync] Try 3/2, retryable exception caught, but retries have been exhausted. Details: Exception.Data didn't contain key LastRequestResponse or its value was null or not a string. Was HttpRequestExceptionExtensions.SetHttpMessagesForTracing called? Encountered an unexpected error. Microsoft.VisualStudio.Services.Common.VssServiceException: TF400813: The user<EMAIL_ADDRESS>is not authorized to access this resource. ..... .....
I have tried creating an entirely new organization with an entirely new Artifacts feed, I've tried using both az login and az devops login with the same results. If I intentionally login to a different azure account which does not have access to the resource, I get a one-line sensible error that my user is not authorized to access this resource, but without the large exception dump.
Furthermore, using the VSTS CLI equivalent of this, which has almost the exact same parameters works great. I was able to upload and download universal files using the VSTS CLI, and have tried downloading those with az artifacts universal and uploading new files, but all with the same results.
UPDATE: I was able to eventually get around this by using removing az devops login and instead having it retrieve my PAT from an environment variable.

@elbatk for visibility into the issue and take the appropriate action here.

@owenhuynmsft

I had the same problem and it turned out to be a network issue. In my case, at least one artifact had to exist inside the folder C:\Users\x.azure\azuredevops\cli\tools\artifacttool\name_of_artifact\ to be able to download the files. Not sure if this is your case but you it is worth trying in case you have not resolved it yet.

Closing this issue in favor of tracking it in the azure-devops extension repo.
Please see https://github.com/Azure/azure-devops-cli-extension/issues/833 for further updates and discussions.


Propose pipeline queueing

This proposal aims to adress race conditions between pipelines, see https://github.com/opendevstack/ods-pipeline/issues/394.
Let's try out a different format this time. Instead of discussing in an issue, this approach allows to discuss one specific proposal PR-style (allowing to comment inline etc.)
Looking forward to feedback of any kind!

I like the PR-style first approach!

I've done some exploratory work on this. While the approach seems generally viable, I encountered the following:

Having a PVC per repository is a prerequisite for this to work properly. Therefore we need to tackle #160 first.
The proposal relies on a mechanism to detect running pipelines. This sounds trivial but it isn't because the Kubernetes API does not support server-side sorting of resources (https://github.com/kubernetes/kubernetes/issues/80602), nor can PipelineRun resources be filtered by their state (filtering is only possible on labels and via field selectors but there is not status field that could be used). As a consequence, all resources need to be retrieved (until we find a running PipelineRun, or have looked at all of them). In turn, this could lead to many API requests or loading lots of resources at once. Therefore I am inclined to tackle #153 first. This would at least ensure that we do not have to retrieve and iterate over an ever-growing number of pipeline runs.

As a result I am going to pause work on this until #160 and #153 are done.
FYI @henrjk the "one PVC per repo" issue has an effect on #412.

Implemented as part of #474.


Change src references to accurately reflect where Bower installs them.

As of right now, when you run bower install json-edit, it goes into a folder named json-edit, which means the names of these references are invalid. So I changed them.
Thanks.

Incomplete, whoops!


Add fanova std

Codecov Report

Merging #159 into development will increase coverage by 0.01%.
The diff coverage is 28.22%.

@@               Coverage Diff               @@
##           development     #159      +/-   ##
===============================================
+ Coverage        47.03%   47.04%   +0.01%
===============================================
  Files               27       27
  Lines             2815     2827      +12
===============================================
+ Hits              1324     1330       +6
- Misses            1491     1497       +6

Impacted Files
Coverage Δ

cave/plot/algorithm_footprint.py
60.22% <ø> (ø)
:arrow_up:

cave/reader/smac3_reader.py
72.72% <0%> (ø)
:arrow_up:

cave/plot/parallel_coordinates.py
13.71% <0%> (ø)
:arrow_up:

cave/cavefacade.py
32.43% <0%> (ø)
:arrow_up:

cave/plot/cost_over_time.py
15.74% <0%> (ø)
:arrow_up:

cave/reader/configurator_run.py
93.22% <100%> (ø)
:arrow_up:

cave/utils/converter/hpbandster2smac.py
24.61% <24.61%> (ø)
:arrow_up:

cave/utils/io.py
59.18% <33.33%> (-2.52%)
:arrow_down:

cave/analyzer.py
33.66% <40.29%> (+0.66%)
:arrow_up:

cave/cave_cli.py
78.99% <46.66%> (ø)
:arrow_up:

... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 172d253...d53bffc. Read the comment docs.