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

Incorrect project build number used in certain scenario #141

Open
apulverizer opened this issue Dec 10, 2020 · 4 comments
Open

Incorrect project build number used in certain scenario #141

apulverizer opened this issue Dec 10, 2020 · 4 comments
Labels
answered Question answered new doc New documentation question Further information is requested

Comments

@apulverizer
Copy link
Contributor

Hi @fescobar

We've run into a problem where when calling the generateReport endpoint, it's storing the results in an older build directory instead of incrementing by 1. For example say we have a reports directory in a project of:

108
109
110
latest

We'd expect the next report to be stored in 111. However it is being stored in 109, for example.

What happened is that we changed the directory where we were storing projects and moved it to a new location. When those directories and report files were moved, it altered the last modified time of the directories.

So then when this is called:

LAST_REPORT_PATH_DIRECTORY=$(ls -td $PROJECT_REPORTS/* | grep -v latest | grep -v $EMAILABLE_REPORT_FILE_NAME | head -1)

It is not returning 110 but is returning 108 which then gets incremented to 109.

Is it possible to actually sort the numeric reports instead of relying on the last modified time?


It seems like a workaround for us is to touch the most recent directory within each project.

@fescobar
Copy link
Owner

Hi @apulverizer when you move your directories do it keeping timestamps

Something like this:

mv --recursive --preserve=timestamps [SOURCE] [DESTINY]

@fescobar fescobar added question Further information is requested waiting for answer Waiting for user's answer labels Dec 10, 2020
@apulverizer
Copy link
Contributor Author

@fescobar thanks, if we move the directories again we'll do that. We made an assumption that the max build number was fetched and then incremented so it didn't occur to us that it was based on the modified time.

@fescobar
Copy link
Owner

@apulverizer I will add documentation about that.

@fescobar fescobar added answered Question answered new doc New documentation and removed waiting for answer Waiting for user's answer labels Dec 11, 2020
@mkrawc
Copy link

mkrawc commented Jan 4, 2022

I also encounter the same issue. I try to store report outputs on S3 and sync it to a volatile docker container to generate a new reports version. The issue is that Amazon S3 doesn't preserve modification times and all times are set to the time when I upload previous results to S3.

A simple change with sorting would solve the issue:

LAST_REPORT_PATH_DIRECTORY=$(ls $PROJECT_REPORTS/ | sort -n | tail -1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Question answered new doc New documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants