Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from pitchmuc:master #92

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

pull[bot]
Copy link

@pull pull bot commented May 28, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@CLAassistant
Copy link

CLAassistant commented May 28, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ pitchmuc
❌ loldenburg
You have signed the CLA already but the status is still pending? Let us recheck it.

@pull pull bot added the ⤵️ pull label May 28, 2024
loldenburg and others added 16 commits May 29, 2024 11:58
getAlert - gets individual Alert
updateAlert - flexible method to do any kind of Alert updating via parameters
disableAlert / enableAlert: disables/enables Alert
deleteAlert: deletes Alert
renewAlerts: Renews a list of Alerts (the API expects a list of IDs here, that's why it is also the only method where we need to pass a list)
Add more Alert methods + reformatting of code.
Right now, the "expansion" parameter for the `getProjects` method is always either the `full` list of `'reportSuiteName,ownerFullName,tags,shares,sharesFullName,modified,favorite,approved,companyTemplate,externalReferences,accessLevel'` or the smaller subset of: 

```            
            params["expansion"] = "ownerFullName,modified"
            if includeShared:
                params["expansion"] += ',shares,sharesFullName'
            if includeTemplate:
                params["expansion"] += ',companyTemplate'
```

In some cases where clients have 10s of thousands of projects, you can speed up the query by limiting the expansion parameters.

Also, the "externalReferences" expansion parameter causes the getProjects request to fail for a client of mine ("Connection broken"). Since `externalReferences` does not contain anything of value for us, we could live without it, but for that we need a way to query getProjects with a custom expansion parameter list.

This simple change will allow that. So thanks for looking at this, @pitchmuc
If a request fails completely (eg "Connection broken" due to giant segments), the connector.py tries again. However, the second time this happens, there is a conflict between the retry parameter in kwargs and the separate retry parameter which leads to a "keyError: 'retry'" error.
This can be avoided via the changes here. I also set time.sleep to the  connector.restTime so this is consistent with the rest of the retries.
Avoid keyError: "retry" in case request fails
Allow getProjects with custom expansion parameters (also to avoid issues with externalReferences column)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants