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

Ip checker #28

Merged
merged 24 commits into from
Sep 13, 2024
Merged

Ip checker #28

merged 24 commits into from
Sep 13, 2024

Conversation

dev-0pz
Copy link
Contributor

@dev-0pz dev-0pz commented Jul 23, 2024

added an ip and dns resolver that has its own unit tests which are used to grab the ips from the files after being displayed out in a reverse/ forward order format and then tested on which ips/dns are reachable

the reason it fails in workflow is because it requires an excel file to run or a csv file, and that isnt provided, it also uses argparse

dev-0pz and others added 16 commits October 27, 2023 09:32
made code smoother and making sure it worked by adding unit testing
which still needs to be finished off
added docstring into create file method
just added or removed every comment
removed pycache files and included a yaml and requirements txt
response to pr changes about docstring and git ignoring files
added openpyxl to requirements.txt
attempting to ignore .idea
deleted all ignore git ignores meaning that all files that should be
ignored are ignored
removed pycache with rm -r--cached fn/__pycache__
removed pycache with rm -r--cached fn/__pycache__
also removed .idea
added ip checker as well as a few unit tests to accompany theses changes
the ip checker should check dns and ips for resolvability and print the
result to the command line to the user
ip checker that resolves dns and ips and lists out the result
with relevant unit tests to accompany it
Copy link
Contributor

@anish-mudaraddi anish-mudaraddi left a comment

Choose a reason for hiding this comment

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

first pass through - will look at tests after

@@ -0,0 +1,36 @@
name: Cloud DNS tests
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be placed in a top-level .github/workflows folder

see https://github.com/stfc/SCD-OpenStack-Utils/tree/master/.github/workflows as an example

reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
:param reverse_order: use reverse or forward order / if true use forward if false use reverse
:return: the text written into the file
"""
print(output_filepath)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this - we can add logging later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed print(output_filepath)

reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
else:
unreachable_dns.append(dns_name)

return reachable_ips, unreachable_ips, reachable_dns, unreachable_dns
Copy link
Contributor

Choose a reason for hiding this comment

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

it feels like you should use a dataclass here - but we can add that later

reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
Copy link
Member

@khalford khalford left a comment

Choose a reason for hiding this comment

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

LGTM, few comments

.gitignore Outdated Show resolved Hide resolved

- name: Analyse with pylint
run: |
cd reverseforwardrecord && pylint $(git ls-files *.py)
Copy link
Member

Choose a reason for hiding this comment

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

Try this and see if it works. It much less messy

Suggested change
cd reverseforwardrecord && pylint $(git ls-files *.py)
pylint reverseforwardrecord

reverseforwardrecord/get_dns_record.py Outdated Show resolved Hide resolved
resolved changes from reviewers kalibh and anish
changing pylint from ls * to pylint reverseforwardrecord
Github was trying to do 20.04 and 22.04 at the same time so nothing
started
Was conflicting in terminal, wouldn't let me install python standard
library packages
Copy link
Member

@khalford khalford left a comment

Choose a reason for hiding this comment

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

LGTM - Once pylint is passing I'm happy to approve

Went through all errors given as well as refining and changing parts of
the code and adding further documentation.
@khalford khalford merged commit e9ddf9a into main Sep 13, 2024
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants