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

ci: fix the failing ci #1045

Merged
merged 17 commits into from
Jul 24, 2023
9 changes: 5 additions & 4 deletions experimentation/tools/sorald/prmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ def generate_pr_message(rule_key: int, num_repairs: int) -> str:


def get_rule_doc_url(rule_key: int, handled_rules_url: str = HANDLED_RULES_URL) -> str:
handled_rules = requests.get(handled_rules_url).content.decode()
handled_rules = requests.get(handled_rules_url, headers={"Content-Type": "text/html"}).content.decode()
markup = BeautifulSoup(handled_rules, features="html.parser")

for a_tag in markup.find_all("a", class_="anchor"):
if a_tag.attrs["id"].endswith(f"sonar-rule-{rule_key}"):
return f"{handled_rules_url}{a_tag.attrs['href']}"
for a_tag in markup.find_all("a", class_="\\\"anchor\\\""):
if f"sonar-rule-{rule_key}" in a_tag.attrs["id"]:
unescaped_atrr = a_tag.attrs["href"].replace("\\\"", "")
return f"{handled_rules_url}{unescaped_atrr}"

raise ValueError(f"No handled rule with key {rule_key}")

Expand Down
2 changes: 1 addition & 1 deletion sorald/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.2</version>
<!-- Used to run ONLY integration tests and skip the unit tests -->
<!-- Run it like so: `mvn verify -DskipUnitTests` -->
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>fr.inria.gforge.spoon.labs</groupId>
<artifactId>gumtree-spoon-ast-diff</artifactId>
<version>1.24</version>
<version>1.62</version>
<exclusions>
<exclusion>
<groupId>org.osgi.service</groupId>
Expand Down